# a=1 # b=10 # Rscript -e "args<-commandArgs(TRUE);x=args[1]:args[2];x;mean(x);sd(x +)" $a $b [1] 1 2 3 4 5 6 7 8 9 10 [1] 5.5 [1] 3.027650
So you can control variables on the command line R script and you can feed these variables into R itself using commandArgs(TRUE), and manipulate the variables as args1 and args2. So if I imagine if you are doing a system call in perl, you can also construct a similar Rscript on the command line, and get the output accordingly, which you can manipulate further within perl (or any other script).
In reply to Re^4: Passing parameters to R script
by Anonymous Monk
in thread Passing parameters to R script
by j1n3l0
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |