R CMD Check: Unusual Checking installed package size note
Asked Answered
S

2

12

I'm fairly new to package development and I am about to start the process of submitting a package to CRAN. I've been striving to get down to 0 errors, 0 warnings, & 0 notes. There is 1 note left that I have not been able to correct (and appears as if it might be an issue with the check?).

When running the check I get the note:

* checking installed package size ... NOTE
  installed size is 19.0Mb
  sub-directories of 1Mb or more:
    Meta   5.0Mb
    R      3.0Mb
    help   5.0Mb
    html   2.0Mb

However, when I navigate to the where the package is installed, none of these printed sizes match up with what Windows Explorer shows. The entire package folder is only 84KB, the Meta folder: 2KB, the R folder: 58KB, the help folder: 19KB, and the html folder 3KB.

I am building the package using R version 3.3.0. What could be causing both the large package size and the discrepancy between R CMD Check and Windows?

Do imports affect the size during the check? (Imports: dplyr, tidyr, magrittr, stringr, SnowballC, igraph, proxy, tm)

Sergias answered 28/7, 2016 at 14:25 Comment(1)
I was examining the installed library files in windows explorer. I think the issue is related to R Studios "Check" button's version of the R CMD check under the Build tab. Running the check with devtools::check() produced 0 errors, 0 warnings, & 0 notesSergias
S
14

The issue appears to be related to the R Studio "Check" button's version of the R CMD check (located on the Build pane). Running the check with devtools::check() produced 0 errors, 0 warnings, & 0 notes. There must be some difference in how the two tools assess a package's installed size. The package has now been successfully uploaded to CRAN.

Sergias answered 29/7, 2016 at 12:2 Comment(1)
Hi ! Note I have the same problem with eclipse when using R CMD check. Your answer was very usefull.Gran
A
1

As an addition: Hadley's 'R packages' book says the following about this topic:

R CMD check is the name of the command you run from the terminal. I don’t recommend calling it directly. Instead, run devtools::check(), or press Ctrl/Cmd + Shift + E in RStudio. In contrast to R CMD check, devtools::check():

  • Ensures that the documentation is up-to-date by running devtools::document().

  • Bundles the package before checking it. This is the best practice for checking packages because it makes sure the check starts with a clean slate: because a package bundle doesn’t contain any of the temporary files that can accumulate in your source package, e.g. artifacts like .so and .o files which accompany compiled code, you can avoid the spurious warnings such files will generate.

  • Sets the NOT_CRAN environment variable to TRUE. This allows you to selectively skip tests on CRAN. (See ?testthat::skip_on_cran for details.)

Judging from the comments it seems using devtools::check instead of R CMD check solved this problem also for other users.

I think the check button of R Studio calls devtools::check() already as a default. But it could be that the default settings were changed - or the devtools package was not installed.

When you go next to the R Studio check button to 'more' and then to 'configure build tools' you get to the build settings. There is a checkbox called 'use devtools package functions if available' which should be checked.

Achromatous answered 13/8, 2020 at 21:16 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.