Created
August 27, 2015 11:00
-
-
Save elifiner/938d53f0289f2234e2f3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
get_help_section_text <- function (func, section) { | |
funcq <- substitute(func) | |
if (!is.character(func)) { | |
func <- deparse(funcq) | |
} | |
Rd <- utils:::.getHelpFile(help(func)) | |
data <- tools:::.Rd_get_section(Rd, section) | |
result <- character() | |
if (length(data)) { | |
result <- tools:::.Rd_get_text(data) | |
result <- result[nzchar(result)] | |
} | |
paste(result, collapse = "\n") | |
} | |
get_help_section_text(cat, "title") | |
get_help_section_text(cat, "description") | |
get_help_section_text(cat, "usage") | |
get_help_section_text(cat, "examples") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment