nanxstats / liftr

🐳 Containerize R Markdown documents for continuous reproducibility
https://nanx.me/liftr/
GNU General Public License v3.0
171 stars 20 forks source link

Extract package names from Rmd source and write to configuration file #3

Open nanxstats opened 9 years ago

nanxstats commented 9 years ago

Possibly using the source parse tree offered by lintr by @jimhester .

https://cran.r-project.org/web/packages/lintr/vignettes/creating_linters.html

nanxstats commented 7 years ago

or try this one (also applies to require(), ::, etc.):

sub(".*library\\(\"(.*?)\"\\).*", "\\1", grep("library\\(", readLines("foo.Rmd"), value = TRUE))
nanxstats commented 7 years ago

Maybe an R function + an RStudio addin for this purpose using the above snippet.

nanxstats commented 6 years ago

Note to self: packrat:::fileDependencies and packrat:::fileDependencies.Rmd should be the right way to go.