Hey all,
A question came up on how to do factorials in R. The answer is that you can
use the factorial function ("factorial"). So, for example:
factorial(6)
[1] 720
6*5*4*3*2*1
[1] 720
Another question that came up was how to save the plots and figures that you
create in R. There are a few ways to do it, but I like to save my plots as
PDF's using the following type of command:
pdf(file= "myPlot.pdf", width = 5, height = 5, family = "Helvetica",
pointsize = 10)
## opens device to save plot, you can specify size, font, etc
plot(xVec, yVec)
## creates plot -- you can also use here "hist" or the "curve"
functions, of course
dev.off()
## closes device and finishes saving
If you move forward saving your plots as PDFs, then you should compile your
LaTeX code using pdflatex. Otherwise, you might get an error.
hope that helps,
Maya