Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to troubleshoot Error: Could not find package root?

Tags:

r

rstudio

I am running the command: devtools::use_testthat()

and I get the error:

Error: Could not find package root.

enter image description here

Why this happens?

like image 217
Chicago1988 Avatar asked Oct 05 '18 16:10

Chicago1988


2 Answers

My problem was very similar, but running devtools::document(setwd(...)). The only thing that worked for me:

  1. I copied the DESCRIPTION file from another package (https://github.com/filipezabala/voice);
  2. I ran devtools::document(setwd(...)) again;
  3. After that, I edited the DESCRIPTION file and ran again devtools::document(setwd(...)).
like image 129
zabala Avatar answered Nov 18 '22 18:11

zabala


devtools appears now to require the user to setwd("~/path/to/package"), even if functions like devtools::release() have the pkg= parameter set correctly.

like image 8
tim Avatar answered Nov 18 '22 17:11

tim