rmd_source: Source the code chunks of an Rmd document

Description Usage Arguments Value Examples

View source: R/rmd_source.R

Description

This is the equivalent of the source() function for Rmd files or their resulting asts.

Usage

1
rmd_source(x, local = FALSE, ..., label_comment = TRUE, use_eval = TRUE)

Arguments

x

An Rmd document (e.g. rmd_ast, rmd_tibble, Rmd file path, etc.)

local

TRUE, FALSE or an environment, determining where the parsed expressions are evaluated. FALSE (the default) corresponds to the user's workspace (the global environment) and TRUE to the environment from which source is called.

...

Additional arguments passed to source.

label_comment

Attach chunk labels as comment before each code block.

use_eval

Use the eval chunk option to determine if code is included.

Value

Returns the result of source() for any R code chunks.

Examples

1
rmd_source(system.file("minimal.Rmd", package = "parsermd"), echo=TRUE)

parsermd documentation built on May 20, 2021, 5:08 p.m.