[R] call to system returns warning : status 2 (Ubuntu)

Uwe Ligges ligges at statistik.tu-dortmund.de
Sun Mar 18 18:35:30 CET 2012



On 18.03.2012 15:39, Eric Elguero wrote:
> Hi everybody,
>
> I have to run under Ubuntu a programs repeatedly
> with different arguments and I am using R just to
> generate the data files and call the external program.
>
> basically, in my script I have inside a loop these two lines:
>
> command<- paste(<some constant or variable strings>,sep="")
> system(command,intern=T,wait=T)
>
> when I run this script, I get a number of warnings,
> like this one:
>
> 16: running command '~/LDhat22/ldconvert -seq ld/serca/serca-Trs.fas
> -freqcut 0.0 -missfreqcut 100.0 -sites 1 3687 -nous 6>
> ld/serca/serca-Trs.out' had status 2

Not sure what status 2 is in ldconvert. Are you sure you get 0 when you 
call it directly? Anyway, the issue may well come from using different 
shells (directly and via the system call).

Uwe Ligges




>
>
> however, when I run the very same command at the bash prompt,
> everything seems fine (no complaint).
>
> in either cases, the output is the same and looks correct.
>
> So, may I just ignore these warnings or is there something
> I should fix?
>
> thank you in advance,
>
> Eric Elguero
> MIVEGEC
> IRD -CNRS - UM1
> Montpellier - France
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.



More information about the R-help mailing list