Skip to content

Instantly share code, notes, and snippets.

@flying-sheep
Created January 16, 2015 13:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save flying-sheep/22d64253009967a990f0 to your computer and use it in GitHub Desktop.
Save flying-sheep/22d64253009967a990f0 to your computer and use it in GitHub Desktop.
helpgrep = function(pattern, topic) {
helpfile = utils:::.getHelpFile(do.call(help, list(topic)))
temp = tools::Rd2txt(helpfile, out = tempfile('Rtxt'))
str = readChar(temp, file.info(temp)$size)
unlink(temp)
lins = unlist(strsplit(str, '\n'))
lins[grep(pattern, lins)]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment