if I have the following code saved in function.R
#' This function is cool
#'
#' blablabla.....
#' @export
#' @param hello a parameter of my function
f_cool <- function(hello) {
# some code
# some other code
}
Is there a way to extract the outline by line number in a list or alike For example
map_fn_definition("function.R")
#> $f_cool
#> $f_cool$line_start
#> 6
#> $f_cool$line_end
#> 9
#> f_cool$title
#> "This function is cool"
there is possibly something possible with roxygen2. But the documentation focuses on the real goal of roxygen (generate .Rd files in packages)
Thanks!
Try
getParseDatain the utils package. (Also look atxml_parse_datain the xmlparsedata package.)giving