rmd_source {parsermd}R Documentation

Source the code chunks of an Rmd document

Description

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

Usage

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


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


[Package parsermd version 0.1.3 Index]