exams (version 2.1-0)

xweave: Wrapper Function for Weaving Either Rnw or Rmd Exercises

Description

Simple wrapper function that either calls Sweave for Rnw exercises or knit for Rmd exercises.

Usage

xweave(file, quiet = TRUE, encoding = NULL, envir = new.env(), pdf = TRUE, png = FALSE, height = 6, width = 6, resolution = 100, ...)

Arguments

file, quiet, encoding
arguments passed to Sweave or knit, respectively.
envir
argument passed to knit.
pdf, png, height, width, resolution, ...
arguments passed to Sweave or opts_chunk, respectively. In the latter case: pdf/png are mapped to dev; height/width are mapped to fig.height/fig.width; and resolution is mapped to dpi.

Details

Depending on whether file has an .Rnw or .Rmd suffix, either Sweave or knit is called for weaving the file. If png = TRUE when calling Sweave, then the resulting includegraphics statements are supplemented with the .png suffix of the corresponding graphics.

See Also

Sweave, knit