function_body.Rd
This wraps around the [`functionBody()`] function to return a list containg the function name and body
function_body(.f, character = FALSE)
.f | character/function; function object or character string of the function name |
---|---|
character | logical; whether to return the body of the function as a vector of character strings with (roughly) one line per entry (TRUE) or as a language object (FALSE, default). Returning a character object is only really useful to understand function length, it is not useful for understanding the content. |
character/language; body of the function as a language or character object depending on `character`
function_body(function_body)#> { #> if (character) { #> language_to_character(functionBody(.f)) #> } #> else { #> functionBody(.f) #> } #> }function_body("function_body", character = TRUE)#> [1] "if (character) {" #> [2] " language_to_character(functionBody(.f))} else {" #> [3] " functionBody(.f)}"