Question

I'm working on an R package, pk, say. I've figured out how to install it using R CMD INSTALL, and I'm also able to check it and use it. Now I want to use the run_examples function in the devtools package to focus on fixing up my examples. But this is what happens:

> require(pk)
> run_examples(pkg = "pk")
Error: Can't find directory pk

Digging into run_examples, it seems to be crashing on the very first line, leading me to find

> is.package("pk")
[1] FALSE

What am I doing wrong?

Was it helpful?

Solution

The pkg parameter needs to be a (full or relative) path to your package code (where DESCRIPTION is located), not only the package name. The default parameter "." works if the current directory is the package directory. Try:

is.package("/path/to/your/pk")
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top