numTerms | R Documentation |
This traverses the R language object and computes the number of individual elements,
e.g., symbols, calls, {
, parameters/formal arguments.
getTerms
can be helpful to see the individual elements and understand
the details of a complex language object. It is like recursive unlist of a top-level language object.
numTerms(x, ctr = mkCounter(self = self, skipIfFalse = skipIfFalse), skipIfFalse = TRUE, self = FALSE)
x |
the R language/code object |
ctr |
the code walker which is a list of functions passed to
|
skipIfFalse |
a scalar logical indicating whether to skip code in |
self |
a scalar logical indicating whether to include certain objects in the count. Typically
leave this as |
numTerms
returns a number.
getTerms
returns a list of all the language elements found in the code.
Duncan Temple Lang
walkCode
numTerms(extractFunctions)
## Not run:
els = as.list(getNamespace("tools"), all.names = TRUE)
# takes about 3.7 seconds (on a macbook pro)
nt = sapply(els, numTerms)
summary(nt)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.