Den 2016-10-04 kl. 03:02, skrev Luck Buttered:

Hi all,

Thank you for your help.  The only original question I am still a bit
stuck on is #3.  I read a lot about the command today, and tried
several approaches, but am unsure how to remove that warning.

* checking sizes of PDF files under ‘inst/doc’ ... WARNING
  ‘gs+qpdf’ made some significant size reductions:
     compacted ‘ePort.pdf’ from 1655Kb to 1076Kb
  consider running tools::compactPDF(gs_quality = "ebook") on these files


I work on a Mac with both RStudio and terminal (can do either).  In
either RStudio or terminal, I could run the command:

compactPDF("inst/doc", qpdf = Sys.which(Sys.getenv("R_QPDF", "qpdf")),
gs_quality = "ebook")

I would not get any output from that. And when I then run:

check()

I noticed the WARNING was still there.

I also ran:

R CMD build --compact-vignettes=gs

What was the output of that command?

Note that using '--compact-vignettes=gs+qpdf', as suggested by the warning message, typically results in even better compression.

But then when I ran check(), I still noticed the WARNING.

Assuming that this is devtools::check(), which I'm unfamiliar with, a quick glance at its man page suggests that it checks (and builds) your *source* file. But the compacted pdfs are in the newly built tarball that resulted from running 'R CMD build', so I think you want devtools::check_built()? Alternatively, It seems to me that you can use devtools::check() and pass on the compacting command through the 'build_args' argument.


Henric Winell




I also ran:

build(compact-vignettes("gs+qpdf"))

which gave me the error:

Error in inherits(x, "package") : object 'compact' not found


I tried a few other syntax I found online, but they mostly gave me warnings.

So, what I would love for any advice/input on, is what I can do to
remove that WARNING (if I must)? I am not sure if I am running
commands incorrectly, running in the wrong folder, should be using
command/Rstudio, etc. Even reading advice online and looking at the
documentation of build and compactPDF is not solving this for me (and
it may be due to my inexperience with R and terminal).

Thanks again for any help!!!

On Sun, Oct 2, 2016 at 3:43 PM, Duncan Murdoch <murdoch.dun...@gmail.com> wrote:
On 02/10/2016 4:05 PM, S johnson wrote:

Hi all,

I am running check() on an R package, and receive one note and one warning
(seem to be related):

* checking installed package size ... NOTE
  installed size is 25.9Mb
  sub-directories of 1Mb or more:

    doc       3.4Mb
    extdata  22.1Mb

* checking sizes of PDF files under ‘inst/doc’ ... WARNING
  ‘gs+qpdf’ made some significant size reductions:
     compacted ‘ePort.pdf’ from 1655Kb to 1076Kb
  consider running tools::compactPDF(gs_quality = "ebook") on these files

After pondering this note, I have three brief questions as follows,

1) When I run "du -hs" on the doc sub-directory, it lists its size as
only 10K. There is only one file inside the doc sub-directory, and
similarly, when I run "du -hs" on that one file, it lists its size as
only 10K. I wonder, then, why check() reports that this sub-directory
called doc is 3.4 Mb?


You are probably looking at the package source; the measurements are made
after installation.  At that point the vignettes have been copied into the
doc directory.


2) My extdata sub-directory is rather large. It is certainly over 1Mb.
This is due to a few dozen example images (.png files) that we feel is
important to include in the package. In general, do notes like these
prevent
CRAN submission acceptance? If so, what would be an alternative? I
imagine there were other packages that had extdata subdirectory with
example components that are larger than 1Mb - and upon a Google search
that seems to be the case. Still, I wanted to seek your input!


There isn't a hard and fast rule.  If the data is necessary for the function
of the package, then it will be allowed.  If it is not needed, then maybe
not.  Often if the data is relatively stable but the code may be improved,
you'll be asked to put them in separate packages, so that CRAN doesn't fill
up with archived repetitions of the same data.


3) I am unfamiliar with what I should consider running compactPDF() on.
None of the files are PDF files. The doc sub-directory has one .R file,
and
the extdata sub-directory has .R files, .png files (taking up the most
space), and .txt files.


That message is likely talking about a vignette.  See the help page
?compactPDF for how to invoke it during a build.

Duncan Murdoch


______________________________________________
R-package-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel

______________________________________________
R-package-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel


______________________________________________
R-package-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel

Reply via email to