parsetools (version 0.1.1)

pd_reconstitute: Reconstitute Expressions

Description

Creates expressions and calls from the given id and parse-data, pd.

Usage

pd_reconstitute(id, pd, .check = TRUE)

Arguments

id

id of the expression of interest

pd

The parse-data information

.check

Perform checks for input validation?

Examples

Run this code
# NOT RUN {
# load example file and get_parse data
ex.file <- system.file("examples", "example.R", package="parsetools")
exprs <- parse(ex.file, keep.source = TRUE)
pd <- get_parse_data(exprs)

# There are 3 expressions so there should be three roots.
sum(pd_is_root(pd$id, pd))
roots <- pd_all_root_ids(pd)

pd_reconstitute(roots[1], pd)
# }

Run the code above in your browser using DataLab