extract_roxygen2 {TheOpenAIR} | R Documentation |
Extract roxygen2 documentation lines from a function definition
Description
This function takes a character vector containing the lines of a function definition and returns a character string containing only the lines belonging to the roxygen2 documentation (lines starting with "#'").
Usage
extract_roxygen2(func_def)
Arguments
func_def |
A character vector containing the lines of a function definition |
Value
A character string containing the roxygen2 documentation lines
Examples
func_def <- c(
"#' Extracts object from a response list",
"#'",
"#' @export",
"object <- function(response) {",
" if (!is.list(response)) {",
" stop('Invalid response format. Expected list object.')",
" }",
"}")
roxygen2_docu <- extract_roxygen2(func_def)
print(roxygen2_docu)
[Package TheOpenAIR version 0.1.0 Index]