R CMD check --as-cran warning
Asked Answered
O

2

35

I am trying to do R CMD check before uploading my package to CRAN.

R CMD check --as-cran "my package folder".

However, it spits out this warning:

"checking for unstated dependencies in examples ... OK

WARNING

pdf is needed for checks on size reduction of PDFs"

I searched online but found no clue to solve this problem. This warning does not turn up when I run "R CMD check" only. And my package works with no problem. Could someone please tell me what might be wrong with my package?

Outwork answered 22/2, 2013 at 23:45 Comment(4)
are you sure it's not qpdf is needed ... ??? https://mcmap.net/q/450405/-qpdf-exe-for-compactpdf ; stat.ethz.ch/R-manual/R-devel/library/tools/html/…Shop
Oh, it turned out to be some random words on my computer "âqpdfâ is ..." so I thought it is "pdf is ...". Thanks a lot!Outwork
Yes. You might want to check your locale: it looks like "smart" quotes are getting turned to gibberish. See the links above.Shop
if possible, please either post an answer to your question (this is allowed and in fact encouraged) or, if you think in hindsight that your question is trivial and won't help any future users, delete it ...Shop
J
23

qpdf is an external program necessary to reduce the size of pdf, it can be downloaded from the sourceforge site. You can install either the 32 bis or 64 bits version, both are working.

To install it, you download the file, and then copy the folder to your program folder.

Next you need to edit you system path to point to the bin folder by adding 'C:\Program Files\qpdf-version_numer\bin'. In a command batch (cmd) type qpdf to see if that has been set correctly, you should get the message

qpdf: an input file name is required

Usage: qpdf [options] infile outfile
For detailed help, run qpdf --help

Once this is done, the warning should be removed from your R CMD check

Jesse answered 20/6, 2017 at 9:35 Comment(4)
Thank you for your complete answer, but I did exactly what you said and I could receive the message on cmd window, but the warning did not removed. Any idea why this happened?Blunder
No I'm sorry, i don't, I know that doing as described above did solve my problem. Have you been installing the right version, 32 bits or 64 bits ?Jesse
qpdf can also be installed via conda-forge.Pluckless
On Debian based systems, qpdf can be install using the command: sudo apt-get install qpdfPelops
O
15

To add to Cedric's answer:

If you are running the 32-bit version of R, it is important that you download the 32-bit version of qpdf, which is the version linked from the SourceForge homepage. If you are running a 64-bit installation of R, you will need to do a bit of digging to locate the 64-bit version of qpdf, which is buried a little more deeply (version 7.0 is listed here).

Once you have extracted the zipped qpdf directory to your hard disk, perhaps under C:\Program Files, added C:\Program Files\qpdf-version_no\bin to your system PATH under the environment variables, and re-launched R so it picks up the new PATH, you need to convince Windows that pqdf is safe to run.

Navigate to C:\Program Files\qpdf-version_numer\bin and execute qpdf.exe (by double-clicking). Windows 10 throws up a security warning as it's an unrecognized executable file. You'll need to use the more options link to find the button to run the program. Once you've done this, Windows will recognize the file as safe to run and allow other programs, including R, to use it.

Outspan answered 11/11, 2017 at 11:51 Comment(1)
thanks, @ms609, your solution helped me to troubleshoot the issue!Juniper

© 2022 - 2024 — McMap. All rights reserved.