开发者

Problem building R package on Windows

I am experimenting with creating a sample R package. I generated the skeleton with:

package.skeleton(name = "hello",environment = .GlobalEnv, path = "c:", force = FALSE)

and build it with:

C:\>R CMD build hello

However, R output the following complains

* checking for file 'hello/DESCRIPTION' ... OK
* preparing 'hello':
* checking DESCRIPTION meta-information ... ERROR
During startup - Warning messages:
1: In library(package, lib.loc = lib.loc, character.only = TRUE, logical.return
= TRUE,  :
' there is no package called 'NULL
 in options("defaultPackages") was not found

I did some digging on Google. Some people seem to suggest that it is a certain character encoding issue. Though, I couldn't find any workaround. I am wondering if anyone here would kn开发者_高级运维ow the solution?

Updates I am using R 2.11.1 in the package provided by Revolution. The problem resolved after switching to R 2.12.1 from CRAN.

Thanks,


The spec for package.skeleton() is:

package.skeleton(name = "anRpackage", list, environment = .GlobalEnv,
    path = ".", force = FALSE, namespace = FALSE,
    code_files = character())

That means "list" is not optional and you have to specify it. It is a list of objects to place in your project.

See here for how to do that:

http://rss.acs.unt.edu/Rdoc/library/utils/html/package.skeleton.html


Updates, I was using R 2.11.1 in the package provided by Revolution when I encountered the problem. The problem resolved after switching to R 2.12.1 from CRAN.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜