简体   繁体   中英

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 know 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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM