parse_text | R Documentation |
Parse expressions residing in character vectors. Similar to parse() but keeping or not the source is controlled by an argument rather than global options.
parse_text(text, ..., keep = TRUE)
text |
the text to parse, normally a character vector but can be
anything that |
... |
additional arguments to be passed on to |
keep |
required setting for option |
This is like parse(text=text,...)
, except that whether or not
the source is kept is controlled by argument keep
, not by
options("keep.source")
.
parse_text
sets options("keep.source")
to keep
(if they are different) before calling parse
and restores it
afterwards.
an expression representing the parsed text, see parse
for
details
The usual setting of option "keep.source" in interactive sessions is TRUE. However, in ‘R CMD check’ it is FALSE.
As a consequence, if the documentation of a package uses functions
that depend on option "keep.source" being TRUE
,
then some examples may run fine when copied and pasted in an R session
but (rightly) fail ‘R CMD check’.
The oposite may also happen, in that the documentation passes 'R CMD check' or Sweave files successfully build but some examples do not work when copied and pasted in an interactive session.
Georgi N. Boshnakov
parse
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.