includeSourceDocuments: Include source files such as Rmd in an Rmd->HTML document

Description Usage Arguments Details Value Examples

Description

This function, when invoked in an Rmd document, will produce links to embedded base64 encodings of source documents. This allows you to include source files (such as Rmd, csv, etc.) inside the HTML file, so that only the HTML file need be uploaded to sites such as RPubs.com or a course management system. By default, the .Rmd document which is being compiled will be included. You can also list files by name.

Usage

1

Arguments

...

Character strings with path and file name of a file to embed. The path should be relative to where the compilation of the Rmd file occurs, which typically will be in the same directory as the Rmd file.additional character strings naming files.

Details

Use this function in an R chunk in an Rmd file. The chunk should use results="asis". Do not embed the HTML file in itself — just the Rmd and whatever other auxiliary files you want to package up with the HTML.

Value

A character string of HTML markup containing the set of links and the base64 encoded embedded files. The string may be quite long.

Examples

1
2
3
4
5
6
## Not run: 
# in an R chunk in the Rmd file
includeSourceDocuments()
includeSourceDocuments("sourceFile.Rmd","myData.csv","mySpreadsheet.xlsx")

## End(Not run)

DataComputing/DataComputing documentation built on May 6, 2019, 1:39 p.m.