R submit to CRAN: which R version to build package?
Asked Answered
M

3

3

I want to submit a package to CRAN. In the CRAN repository policy it states that "Packages for which R CMD check gives an ‘ERROR’ when a new R x.y.0 version is released will be archived".

It also says "Please ensure that R CMD check --as-cran has been run on the tarball to be uploaded before submission".

Running R CMD check --as cran on my tarball gives me the warning:

Warning: unknown option ‘--as-cran’

I am running R version 2.14.1 on Ubuntu 12.04.2 LTS. Can I build a source package using this version or do I have to use R 3.0?

And why does R CMD check --as-cran not work for me?

Monogenesis answered 19/6, 2013 at 13:48 Comment(3)
When you say R CMD check --as-cran doesn't work for you, what do you mean? What error message to you get?Edmead
I get no error but the warning as posted above.Monogenesis
Your R version doesn't have the --as-cran check, because it was introduced in R 2.14.2 ...Payola
E
5

The document you link to says:

Please ensure that R CMD check --as-cran has been run on the tarball to be uploaded before submission. This should be done with the current release of R or (preferably) R-devel or R-patched.

So, right now, you should use R-3.0.1 and also test against the R-devel branch (if possible).

Edmead answered 19/6, 2013 at 13:50 Comment(4)
This sounds reasonable, I am trying to install R 3.0.1 now to see if R CMD check --as-cran works.Monogenesis
Just installed R 3 and it does not give the warning for the --as-cran argument anymore. I will check my package with this version before submitting. Many thanks!Monogenesis
You might want to add the argument --vanilla too, though maybe this is captured in --as-cran. It ensures that none of your local files are read during start up.Bursitis
Or use devtools::check() which does it's best to simulate exactly what cran does.Sunless
Z
1

From the current October 2015 CRAN policy: "Please ensure that R CMD check --as-cran has been run on the tarball to be uploaded before submission. This should be done with the current version of R-devel (or if that is not possible and explained in the submission, current R-patched or the current release of R.)"

This, I believe is a change from the policy described in the original accepted answer.

docker/rocker is a way to achieve this fairly easily without mucking up your development environment.

I think it is correct to build with the latest release version, but test with R-devel and the latest release.

Zinck answered 4/10, 2015 at 13:1 Comment(0)
S
1

You can try the new starfox/r-devel container available at https://hub.docker.com/r/starfox/r-devel/. It contains already some packages, which will make your release more convenient. There is also a guide how to use it.

Disclaimer: I am the maintainer of both, the container and the guide.

Selfpropelled answered 18/10, 2015 at 20:39 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.