identifyfuns | R Documentation |
identifyfuns is used when tracing the interactions between functions within R packages. It uses the vector of character vectors that is produced by readLines and identifies the starting lines of all functions. It ignores all functions defined within comments, as well as ignoring all functions defined internally to other functions. It does the latter by testing for a couple of spaces at the start of a line containing a function definition, which functions defined within another function should have.
identifyfuns(content)
content |
the output of applying readLines to a text file containing R code. |
a vector of line numbers identifying the start of all functions within the content. This may be a vector of zero length if there are no functions.
describefunctions, findfuns
txt <- c("# this is a comment",
"dummy <- function() { return(NULL) }",
"# a possibly confusing use of function",
"anotherdummy <- function() { return(NULL) }")
identifyfuns(txt)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.