get_formals | R Documentation |
Returns the arguments of a function from a valid R file.
get_formals(uri, content, func)
uri |
Path to R file. |
content |
R code as string. |
func |
Function name. If a function is defined multiple times inside the provided file, only the last occurence will be considered. |
A named character vector as returned by formals()
.
uri <- system.file("testfiles/funcs.R", package = "toscutil")
content <- readLines(uri)
func <- "f2"
if (requireNamespace("languageserver", quietly = TRUE)) {
get_formals(uri, content, func)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.