Created
July 19, 2018 20:26
-
-
Save muschellij2/3ada684aef1ff1930a5a51bbf8294845 to your computer and use it in GitHub Desktop.
Get all exampls
This file contains hidden or 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
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