powered by
Returns the arguments of a function from a valid R file.
get_formals(uri, content, func)
A named character vector as returned by formals().
formals()
Path to R file.
R code as string.
Function name. If a function is defined multiple times inside the provided file, only the last occurence will be considered.
uri <- system.file("testfiles/funcs.R", package = "toscutil") content <- readLines(uri) func <- "f2" if (requireNamespace("languageserver", quietly = TRUE)) { get_formals(uri, content, func) }
Run the code above in your browser using DataLab