Page 1 of 1

Trouble getting started with using R2MLwiN in R

Posted: Tue Jan 30, 2018 2:55 am
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'

Re: Trouble getting started with using R2MLwiN in R

Posted: Tue Jan 30, 2018 10:39 am
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.

Re: Trouble getting started with using R2MLwiN in R

Posted: Tue Jan 30, 2018 2:25 pm
by xmc12345
Thank you for the suggestions! specifying an absolute path did the trick.