rmd_to_pdf: Make a PDF from a R Markdown file

Description Usage Arguments Value Examples

Description

For this function you'll need to have two other programs installed on your computer. These programs are not part of R, so the first time you use this function you'll need to leave R, install these programs, then RESTART R before running this fuction. After the first run, you don't need to restart again when using this function. Here are the two other programs you need: (1) Pandoc and (2) LaTeX, follow the instructions on the Pandoc download page: http://johnmacfarlane.net/pandoc/installing.html

Usage

1
  rmd_to_pdf(my_rmd_filename, wd, ...)

Arguments

my_rmd_filename

the filename of your R Markdown file, without the .Rmd bit on the end. The file name must be in quote marks

wd

the full path of the folder that contains your Rmd file. The path must be in quote marks. You can find the path by opening the folder on your desktop and then right-clicking on the R Markdown file and clicking 'Properties' (on windows) or 'Get Info' (on a Mac). Note that the path must have forward slashes (/) separating the parts of the path, not backslashes (\), which are the default on windows. You will have to replace the slashes by hand before running this function.

Value

a PDF in your working directory, and in the console you'll get the full path to where that PDF is (should be the same as what you put in the function to make the PDF)

Examples

1
2
3
# hopefully your path will be simpler than mine!
 rmd_to_pdf("my_lab_report",
           "E:/My Documents/My UW/Teaching/2008 482 Geoarchaeology/2013 Autumn 482 & 486/AU13 482 & 486 Lab report/AU13-ARCHY-486-Geoarchaeology-Lab/au13_uw_geoarch_lab/au13_uw_geoarch_lab")

benmarwick/au13uwgeoarchlab documentation built on May 12, 2019, 1:01 p.m.