Skip to content

Instantly share code, notes, and snippets.

@hadley
Created June 22, 2012 15:49
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 hadley/2973625 to your computer and use it in GitHub Desktop.
Save hadley/2973625 to your computer and use it in GitHub Desktop.
library(tools)
show_rd2 <- function(pkg = NULL, file, ...) {
pkg <- as.package(pkg)
if (file_ext(file) == "") file <- paste(file, ".Rd", sep ="")
path <- file.path(pkg$path, "man", file)
stopifnot(file.exists(path))
temp <- Rd2HTML(path, out = tempfile("Rtxt"), package = pkg$package,
...)
temp_html <- paste0(temp, ".html")
file.rename(temp, temp_html)
browseURL(paste0("file://", temp_html))
}
environment(show_rd2) <- environment(load_all)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment