Trouble getting started with using R2MLwiN in R

Welcome to the forum for R2MLwiN users. Feel free to post your question about R2MLwiN here. The Centre for Multilevel Modelling take no responsibility for the accuracy of these posts, we are unable to monitor them closely. Do go ahead and post your question and thank you in advance if you find the time to post any answers!

Go to R2MLwiN: Running MLwiN from within R >> http://www.bris.ac.uk/cmm/software/r2mlwin/
Post Reply
xmc12345
Posts: 2
Joined: Tue Jan 30, 2018 2:41 am

Trouble getting started with using R2MLwiN in R

Post by xmc12345 »

Hi there,

I'm a new user to MLwiN, and am trying to use the "mlnscript" for Mac OSX in order to use the R2MLwiN package in R. I have the 'MLN.dmg' file downloaded, extracted four files (including the mlscript) within, and saved it in a separate folder on my computer.

I am using R2MLwiN version 0.8-5,R version 3.4.3 , a Mac OSX 10.11.6. The MLN

I keep getting an error message which I can't quite figure out...am not sure why R can't find the mlnscript file, and I'm pretty sure I am not getting the path name wrong. Any help or suggestions would be much appreciated! My code is below:

Code: Select all

library(R2MLwiN)
options(MLwiN_path='~/user/folder/mlnscript')
data(tutorial, package = "R2MLwiN") 
(mymodel1 <- runMLwiN(normexam ~ 1 + sex + (1 | student), data = tutorial))
 
/bin/sh: ~/user/folder/mlnscript: No such file or directory
Error in read.dta(IGLSfile) : 
  unable to open file: 'No such file or directory'
ChrisCharlton
Posts: 1351
Joined: Mon Oct 19, 2009 10:34 am

Re: Trouble getting started with using R2MLwiN in R

Post by ChrisCharlton »

I would suggest that to start with you try running the command ~/user/folder/mlnscript directly from the Terminal application to see whether that gives any error messages. If so you need to double-check that the folder where you copied the files does actually correspond to this. You could also try specifying it as an absolute path to see whether that works.
xmc12345
Posts: 2
Joined: Tue Jan 30, 2018 2:41 am

Re: Trouble getting started with using R2MLwiN in R

Post by xmc12345 »

Thank you for the suggestions! specifying an absolute path did the trick.
Post Reply