Before running this script, n should be defined, for instance, from the terminal,

Rscript -e 'n=rpois(1,1000); templater::render_template("example_cor.Rmd",output=sprintf("example_cor_%d.html",n))'

A correlation with r n points:

x <- rnorm(n)
y <- x/2+rnorm(n)
plot( x, y )
abline(coef(lm(y~x)))


petrelharp/templater documentation built on May 25, 2019, 2:54 a.m.