Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Call R function in Linux command line

Is there a way to directly call R functions from Linux command line without going into R environment? It doesn't work for me by just running a R file, since I need to specify the parameters of the function every time I run it.

like image 982
Candy Avatar asked Jul 14 '11 23:07

Candy


1 Answers

A simple built-in is the following BASH commands:

export NUM=10
R -q -e "rnorm($NUM)"
like image 154
Mike T Avatar answered Sep 21 '22 06:09

Mike T