pd_reconstitute: Reconstitute Expressions

Description Usage Arguments Examples

Description

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

Usage

1
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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
# 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)

parsetools documentation built on April 14, 2020, 5:32 p.m.