0

I'm using Amelia package to imput my dataset, when I'm using R console I can run my R script without any issue and I get the result, but when I try to execute it trough command line (in mac) it does not work properly. Here is what happens:

username$ Rscript RScript.r
Loading required package: foreign
## 
## Amelia II: Multiple Imputation
## (Version 1.6.4, built: 2012-12-17)
## Copyright (C) 2005-2016 James Honaker, Gary King and Matthew Blackwell
## Refer to http://gking.harvard.edu/amelia/ for more information
## 

and then it halts whithout proceeding further. I'm new to R and I just want to run the R script that I have from my python code in order to impute my dataset that's why I need this to be run using command line.

Mah Shid
  • 1
  • 1
  • Aer your script expecting to read from a file? Might be r waiting for input on standard input? – Andreas Louv Dec 05 '16 at 04:15
  • Depending on your data imputation can take some time and I've even occasionally had a Markov Chain that apparently didn't converge. – Roland Dec 05 '16 at 08:44
  • @andlrc yes actually it does but the file is in the same folder. Should I do anything in addition for reading from file? Here is the R script : `code' library(Amelia) require(foreign) idvars = c( 'Text', 'photo' ) mydata = read.csv("file.csv") a.out = amelia( mydata, idvars = idvars ) write.amelia( a.out, file.stem = 'impData' ) – Mah Shid Dec 05 '16 at 16:08
  • @MahShid Not when you explicit set the file to be read like that. – Andreas Louv Dec 05 '16 at 16:13
  • 1
    Update: I tried running my script in windows , the same thing happens. I think the problem relates with Amelia package in R as I could run other R scripts via command-line which use common R packages but no luck with Amelia yet. – Mah Shid Dec 05 '16 at 21:13
  • 1
    You're going to need to provide a [reproducible example](http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example) for anyone to be able to help you. – alexwhitworth Dec 06 '16 at 23:40

0 Answers0