Skip to content

Instantly share code, notes, and snippets.

@muschellij2
Created July 19, 2018 20:26
Show Gist options
  • Save muschellij2/3ada684aef1ff1930a5a51bbf8294845 to your computer and use it in GitHub Desktop.
Save muschellij2/3ada684aef1ff1930a5a51bbf8294845 to your computer and use it in GitHub Desktop.
Get all exampls
man = list.files(path = "man", full.names = TRUE)
library(tools)
ll = lapply(man, function(x) {
o = tempfile(fileext = ".R")
tools::Rd2ex(x, out = o)
if (file.exists(o)) {
return(readLines(o))
}
return("")
})
ex = unlist(ll)
writeLines(ex, "~/Desktop/all_examples.R")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment