export_code: Export several code chunks from Rmd to R

Description Usage Arguments Details Value See Also Examples

Description

For use in creating a data repo, indicate all the code chunks used to create a specific subset of data

Usage

1
export_code(file, chunks, output_file, output_dir = "auto")

Arguments

file

The .Rmd file to parse

chunks

A character vector of the code chunk labels to keep

output_file

The filename to write to (no extension)

output_dir

The directory to write the file to (ending with trailing slash), Default: "auto"

Details

DETAILS

Value

OUTPUT_DESCRIPTION

See Also

case_when knit,read_chunk map

Examples

1
2
3
4
5
6
7
8
9
## Not run: 
# In the puddingR default directory
export_code("analysis.Rmd", chunks = c("load_data", "find_average"), output_file = "average")

#' # If not in the puddingR default directory
export_code("analysis.Rmd", chunks = c("load_data", "find_average"),
output_file = "average", output_dir = "myFolder/")

## End(Not run)

the-pudding/puddingR documentation built on June 25, 2019, 12:15 a.m.