Rscript
Today I learned about Rscript, a way to call R from the command line.
Let's say I want to perform the following Chi-Square test in R, from the command line. Then I can do so from the command line as follows. Which means that I can capture the result in Ruby as follows:
x=matrix(c(143,75, 213,69),nrow=2); chisq.test(x)
Rscript -e \"x=matrix(c(143,75, 213,69),nrow=2); chisq.test(x)
a=`Rscript -e \"x=matrix(c(143,75, 213,69),nrow=2); chisq.test(x)\"`