r - Build & Reload in RStudio on Windows: devtools::document() says devtools not found -


when click "build & reload" on build tab within rstudio, following error:

==> devtools::document(roclets=c('rd', 'collate', 'namespace'))  error in loadnamespace(name) : there no package called 'devtools' calls: suppresspackagestartupmessages ... trycatch -> trycatchlist -> trycatchone -> <anonymous> execution halted  exited status 1. 

but when enter devtools::document(roclets=c('rd', 'collate', 'namespace')) directly console, works.

in addition, if uncheck "build & reload" under "automatically roxygenize when running:" in build tools -> roxygen config, error disappears.

i've installed latest devtools devtools::install_github("hadley/devtools"). i'm using windows.

if has suggestions, thank in advance!

here's convenient solution based on mathematical.coffee's comment:

just run rstudio:

writelines("install.packages('devtools', repos = 'https://cran.rstudio.com/')", "inst.r") system("rscript --vanilla inst.r") 

Comments

Popular posts from this blog

cakephp - simple blog with croogo -

How to group boxplot outliers in gnuplot -

bash - Performing variable substitution in a string -