문제

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?

도움이 되었습니까?

해결책

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")
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top