View source: R/packageAnalysis.R
findLiterals | R Documentation |
This finds all literal values such as
TRUE
, FALSE
, numbers,
strings in an R code/language object.
findLiterals(code,
walker = mkLiteralCollector(ignoreParams, skipIfFalse = skipIfFalse, ...),
ignoreParams = TRUE, skipIfFalse = TRUE, ...)
code |
the R language/code object in which to search for literals. |
walker |
a code-walker function that traverses the code and tests whether a language object is a literal value and collects it if so. |
ignoreParams |
a scalar logical value controlling
whether to process the code for the default values of parameters/formal arguments
in a function object, with |
skipIfFalse |
a logical value that if |
... |
additional arguments that are passed to |
This returns the collected values from walker
.
Duncan Temple Lang
The codetools
package.
findCallsTo
f = function(x = "abc") {
a = 1L
b = 3.1415
c = "xyz"
if(a < 10)
paste(x, c, sep = " - ")
else
x
}
findLiterals(f)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.