exams2pdf(file, n = 1L, nsamp = NULL, dir = ".", template = "plain",
inputs = NULL, header = list(Date = Sys.Date()), name = NULL,
control = NULL, quiet = TRUE, edir = NULL, tdir = NULL, sdir = NULL)
make_exams_write_pdf(template = "plain", inputs = NULL,
header = list(Date = Sys.Date()), name = NULL, quiet = TRUE,
control = NULL)file.file. Sampling without replacement is used
if possible. (Only if some element of nsamp is larger than
the length of the corresponding element in n is greater than 1 (or template is longer than 1).
Current working directory is used by default."exam", "solution", "plain".
For details see below.edir.template.file are stored (see also below).tempdir.tempdir.exams2pdf is a proof-of-concept implementation of the new
extensible xexams framework. It is a (slightly less
efficient) reimplementation of the old exams function.
It proceeds by using make_exams_write_pdf to set up a custom
driver$write function on the fly before calling xexams.
This custom driver combines each exams with the desired template
(and inputs etc.) and then calls texi2dvi
on the resulting LaTeX file to produce PDF output.
For a single exams (n = 1) the resulting PDF is displayed on
screen while for n > 1 some output directory dir has
to be specified where the PDF files are stored. For more details see
the original exams function.xexams,
exams,
texi2dvi## load package and enforce par(ask = FALSE)
options(device.ask.default = FALSE)
if(interactive()) {
## compile a single random exam (displayed on screen)
exams2pdf(list(
"boxplots",
c("tstat", "ttest", "confint"),
c("regression", "anova"),
"scatterplot",
"relfreq"
))
}Run the code above in your browser using DataLab