Re: [R-pkg-devel] Note and warning about subdirectory sizes
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 But then when I ran check(), I still noticed the WARNING. 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 Murdochwrote: > 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
Re: [R-pkg-devel] .gitkeep file to prevent folder from erasing when empty
Hello everyone: Inside .Rbuildignore, I put the following line: ^OutputFolder$ However, I notice that the extdata/OutputFolder still disappears if there are no files inside of it. (I am thinking this happens when I push changes to Github). I am trying to keep the extdata/OutputFolder present (whether or not it has files inside of it) for both github and when I submit the package. Thanks again for any input you may have! On Mon, Oct 3, 2016 at 8:15 AM, Luck Butteredwrote: > Hello everyone: > > Thank you for the helpful suggestions! > > I moved the directory name to the .Rbuildignore file, as Johannes > suggested. > > Uwe, thanks for bringing up that topic! Yes, I read that we cannot > automatically write files to user's filespace (outside of tempdir()). So, > there is nothing in our package that will automatically write to user's > filespace. However, we do allow users to manually enter the suggested path > when going over examples in the vignette (which is the > extdata/OutputFolder). > > We did not think about if users cannot have write access to that folder. > However, that will not render the package useless for them. Instead, they > can manually enter an output folder pathway that works for them, and follow > the vignette examples that way. The presence of the extdata/OutputFolder > is just recommended for simplicity with following examples (and if write > available for users). > > Thanks again! > > On Mon, Oct 3, 2016 at 2:25 AM, Uwe Ligges de> wrote: > >> >> >> On 03.10.2016 08:13, Johannes Ranke wrote: >> >>> Hi, >>> >>> You can include the .gitkeep file in .Rbuildignore. This will prevent it >>> from >>> being present in the package you test or submit, but git willl still see >>> it >>> and keep the directory. >>> >>> Johannes >>> >>> Am Montag, 3. Oktober 2016, 00:03:33 schrieb Luck Buttered: >>> Hello everyone: I am working on a vignette for a package that outputs reports for users. As part of the vignette, users can manually run eval=FALSE code that creates example reports. These example reports that they create can be saved to an output folder within extdata (extdata/OutputFolder). >>> >> >> Note that this is a bad idea. >> Your users may not have write access to that folder, e.g. for network >> wiede installation as the one at my department. >> Also, you have to ask users (por let them enter a path or file) before >> writing somewhere on the filespace if not tempdir(). >> >> Best, >> Uwe Ligges >> >> >> >> >> When I submit to CRAN, I will be sure that OutputFolder is empty. However, whenever I make it empty, the entire folder disappears. To combat this problem, I have placed a .gitkeep file within the OutputFolder. I *believe* the presence of the .gitkeep file works as intended (prevents the automatic removal of the OutputFolder when empty). However, upon running check(), I receive a note: *checking for hidden files and directories ... NOTE* *Found the following hidden files and directories:* * inst/extdata/OutputFiles/.gitkeep* *These were most likely included in error. See section ‘Package* *structure’ in the ‘Writing R Extensions’ manual.* Does anyone have advice on how to effectively remove this note? Otherwise, does my rationale above seem like a reasonable purpose for keeping the note? Thank you for helping me approach this! [[alternative HTML version deleted]] __ 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 >> > > [[alternative HTML version deleted]] __ R-package-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-package-devel
Re: [R-pkg-devel] Understanding notes from win-builder
On 03/10/2016 3:04 PM, Roy Mendelssohn - NOAA Federal wrote: Thanks. The tests were not taking extraordinary amounts of time (roughly 30-40s) but they were greater than 10s. I retested with all the tests commented to be not tested, but based on this I have changed it so there is one simple test for each, and will see what those times are. I will add those in my cran-comments and see what comes of it. When I check internally, there are no problems, as the downloads are much faster, and varies depending on where I do the testing. A possibility would be to include a small number of sample pages with your package, and offer a way to view them in a browser, or run your functions on them. The system.file() function will give the installed location of those files. For example, if you put sample.html in your package in directory inst/SamplePages, it will be installed into /SamplePages/sample.html in your library, and can be browsed using browseURL(system.file("SamplePages/sample.html", package = "")) (with appropriate substitutions for , of course). You probably don't want to call browseURL() in a test, but you can use if (interactive()) browseURL( ... ) Duncan Murdoch -Roy > On Oct 3, 2016, at 11:56 AM, Duncan Murdochwrote: > > On 03/10/2016 1:22 PM, Hadley Wickham wrote: >> On Mon, Oct 3, 2016 at 12:10 PM, Roy Mendelssohn - NOAA Federal >> wrote: >> > Hi All: >> > >> > I am working on preparing a package for submission to CRAN, so using devtools i submitted the package to win-builder. I really appreciate that this has been setup, so that hopefully any final submission will be smooth. win-builder returned three notes, and I am unclear on them in the sense of not certain what I should do to resolve them so hopefully there will be no notes on submission. The first one is: >> > >> >> The Title field starts with the package name. >> >> The Title field should be in title case, current version then in title case: >> >> 'xtractomatic: An R package for accessing environmental data' >> >> 'Xtractomatic: An R Package for Accessing Environmental Data' >> >> >> > >> > the package name is "xtractomatic", but is the last line what is preferred in the DESCRIPTION file? >> >> On CRAN (and in other locations), packages are listed as >> "package_name: package_title", which in your case would lead to: >> >> xtractomatic: xtractomatic: An R package for accessing environmental data >> >> So you need to first eliminate "xtractomatic" from the title. CRAN >> generally also considers "an R package" to be obvious from the context >> so you also need to remove that. That leaves you with "Accessing >> Environmental Data" and suggests you might want to be a bit more >> specific. >> >> > The other two notes are essentially the same: >> > >> >> * checking examples ... >> >> ** running examples for arch 'i386' ... [87s] NOTE >> >> Examples with CPU or elapsed time > 10s >> >>user system elapsed >> >> xtracto3.29 0.81 36.49 >> >> xtracto_3D 3.14 0.64 31.40 >> >> xtractogon 0.92 0.20 10.73 >> >> ** running examples for arch 'x64' ... [104s] NOTE >> >> Examples with CPU or elapsed time > 10s >> >>user system elapsed >> >> xtracto2.83 0.64 43.68 >> >> xtracto_3D 2.58 0.72 43.60 >> >> >> > >> > I assume the problem here is the amount of time to run the examples. The problem is that what this package does is download data from a remote server, and times can vary a lot on the examples. Is this a show stopper when I submit to CRAN? I can try to simplify the examples to cut down on the time. Alternatively, will it help to include this in the cram-comments.md file? >> >> You can use \donttest{} to tell CRAN to not run it as part of their >> automated tests. > > But do leave in some tests, so the code that actually does something with the data gets exercised, and users who may not have Internet access when they look at your examples can see something. > > Duncan Murdoch ** "The contents of this message do not reflect any position of the U.S. Government or NOAA." ** Roy Mendelssohn Supervisory Operations Research Analyst NOAA/NMFS Environmental Research Division Southwest Fisheries Science Center ***Note new address and phone*** 110 Shaffer Road Santa Cruz, CA 95060 Phone: (831)-420-3666 Fax: (831) 420-3980 e-mail: roy.mendelss...@noaa.gov www: http://www.pfeg.noaa.gov/ "Old age and treachery will overcome youth and skill." "From those who have been given much, much will be expected" "the arc of the moral universe is long, but it bends toward justice" -MLK Jr. __ R-package-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-package-devel
Re: [R-pkg-devel] Understanding notes from win-builder
In your examples section, do something like this: \donttest{ Sys.sleep(100) # long running example code here } -- Brian On Mon, 2016-10-03 at 10:44 -0700, Roy Mendelssohn - NOAA Federal wrote: > Hi Hadley: > > > You can use \donttest{} to tell CRAN to not run it as part of their > > automated tests. > > > > Hadley > > > > Thank you for the responses. On the response above, \donttest{} goes where? > Is that in each R files where I have an example, or somewhere else? > > -Roy > > ** > "The contents of this message do not reflect any position of the U.S. > Government or NOAA." > ** > Roy Mendelssohn > Supervisory Operations Research Analyst > NOAA/NMFS > Environmental Research Division > Southwest Fisheries Science Center > ***Note new address and phone*** > 110 Shaffer Road > Santa Cruz, CA 95060 > Phone: (831)-420-3666 > Fax: (831) 420-3980 > e-mail: roy.mendelss...@noaa.gov www: http://www.pfeg.noaa.gov/ > > "Old age and treachery will overcome youth and skill." > "From those who have been given much, much will be expected" > "the arc of the moral universe is long, but it bends toward justice" -MLK Jr. > > __ > 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
Re: [R-pkg-devel] Understanding notes from win-builder
Hi Hadley: > You can use \donttest{} to tell CRAN to not run it as part of their > automated tests. > > Hadley > Thank you for the responses. On the response above, \donttest{} goes where? Is that in each R files where I have an example, or somewhere else? -Roy ** "The contents of this message do not reflect any position of the U.S. Government or NOAA." ** Roy Mendelssohn Supervisory Operations Research Analyst NOAA/NMFS Environmental Research Division Southwest Fisheries Science Center ***Note new address and phone*** 110 Shaffer Road Santa Cruz, CA 95060 Phone: (831)-420-3666 Fax: (831) 420-3980 e-mail: roy.mendelss...@noaa.gov www: http://www.pfeg.noaa.gov/ "Old age and treachery will overcome youth and skill." "From those who have been given much, much will be expected" "the arc of the moral universe is long, but it bends toward justice" -MLK Jr. __ R-package-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-package-devel
Re: [R-pkg-devel] Understanding notes from win-builder
On Mon, Oct 3, 2016 at 12:10 PM, Roy Mendelssohn - NOAA Federalwrote: > Hi All: > > I am working on preparing a package for submission to CRAN, so using devtools > i submitted the package to win-builder. I really appreciate that this has > been setup, so that hopefully any final submission will be smooth. > win-builder returned three notes, and I am unclear on them in the sense of > not certain what I should do to resolve them so hopefully there will be no > notes on submission. The first one is: > >> The Title field starts with the package name. >> The Title field should be in title case, current version then in title case: >> 'xtractomatic: An R package for accessing environmental data' >> 'Xtractomatic: An R Package for Accessing Environmental Data' >> > > the package name is "xtractomatic", but is the last line what is preferred in > the DESCRIPTION file? On CRAN (and in other locations), packages are listed as "package_name: package_title", which in your case would lead to: xtractomatic: xtractomatic: An R package for accessing environmental data So you need to first eliminate "xtractomatic" from the title. CRAN generally also considers "an R package" to be obvious from the context so you also need to remove that. That leaves you with "Accessing Environmental Data" and suggests you might want to be a bit more specific. > The other two notes are essentially the same: > >> * checking examples ... >> ** running examples for arch 'i386' ... [87s] NOTE >> Examples with CPU or elapsed time > 10s >>user system elapsed >> xtracto3.29 0.81 36.49 >> xtracto_3D 3.14 0.64 31.40 >> xtractogon 0.92 0.20 10.73 >> ** running examples for arch 'x64' ... [104s] NOTE >> Examples with CPU or elapsed time > 10s >>user system elapsed >> xtracto2.83 0.64 43.68 >> xtracto_3D 2.58 0.72 43.60 >> > > I assume the problem here is the amount of time to run the examples. The > problem is that what this package does is download data from a remote server, > and times can vary a lot on the examples. Is this a show stopper when I > submit to CRAN? I can try to simplify the examples to cut down on the time. > Alternatively, will it help to include this in the cram-comments.md file? You can use \donttest{} to tell CRAN to not run it as part of their automated tests. Hadley -- http://hadley.nz __ R-package-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-package-devel
[R-pkg-devel] Understanding notes from win-builder
Hi All: I am working on preparing a package for submission to CRAN, so using devtools i submitted the package to win-builder. I really appreciate that this has been setup, so that hopefully any final submission will be smooth. win-builder returned three notes, and I am unclear on them in the sense of not certain what I should do to resolve them so hopefully there will be no notes on submission. The first one is: > The Title field starts with the package name. > The Title field should be in title case, current version then in title case: > 'xtractomatic: An R package for accessing environmental data' > 'Xtractomatic: An R Package for Accessing Environmental Data' > the package name is "xtractomatic", but is the last line what is preferred in the DESCRIPTION file? The other two notes are essentially the same: > * checking examples ... > ** running examples for arch 'i386' ... [87s] NOTE > Examples with CPU or elapsed time > 10s >user system elapsed > xtracto3.29 0.81 36.49 > xtracto_3D 3.14 0.64 31.40 > xtractogon 0.92 0.20 10.73 > ** running examples for arch 'x64' ... [104s] NOTE > Examples with CPU or elapsed time > 10s >user system elapsed > xtracto2.83 0.64 43.68 > xtracto_3D 2.58 0.72 43.60 > I assume the problem here is the amount of time to run the examples. The problem is that what this package does is download data from a remote server, and times can vary a lot on the examples. Is this a show stopper when I submit to CRAN? I can try to simplify the examples to cut down on the time. Alternatively, will it help to include this in the cram-comments.md file? Any advice will be greatly appreciated. -Roy ** "The contents of this message do not reflect any position of the U.S. Government or NOAA." ** Roy Mendelssohn Supervisory Operations Research Analyst NOAA/NMFS Environmental Research Division Southwest Fisheries Science Center ***Note new address and phone*** 110 Shaffer Road Santa Cruz, CA 95060 Phone: (831)-420-3666 Fax: (831) 420-3980 e-mail: roy.mendelss...@noaa.gov www: http://www.pfeg.noaa.gov/ "Old age and treachery will overcome youth and skill." "From those who have been given much, much will be expected" "the arc of the moral universe is long, but it bends toward justice" -MLK Jr. __ R-package-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-package-devel
Re: [R-pkg-devel] .gitkeep file to prevent folder from erasing when empty
Hello everyone: Thank you for the helpful suggestions! I moved the directory name to the .Rbuildignore file, as Johannes suggested. Uwe, thanks for bringing up that topic! Yes, I read that we cannot automatically write files to user's filespace (outside of tempdir()). So, there is nothing in our package that will automatically write to user's filespace. However, we do allow users to manually enter the suggested path when going over examples in the vignette (which is the extdata/OutputFolder) . We did not think about if users cannot have write access to that folder. However, that will not render the package useless for them. Instead, they can manually enter an output folder pathway that works for them, and follow the vignette examples that way. The presence of the extdata/OutputFolder is just recommended for simplicity with following examples (and if write available for users). Thanks again! On Mon, Oct 3, 2016 at 2:25 AM, Uwe Liggeswrote: > > > On 03.10.2016 08:13, Johannes Ranke wrote: > >> Hi, >> >> You can include the .gitkeep file in .Rbuildignore. This will prevent it >> from >> being present in the package you test or submit, but git willl still see >> it >> and keep the directory. >> >> Johannes >> >> Am Montag, 3. Oktober 2016, 00:03:33 schrieb Luck Buttered: >> >>> Hello everyone: >>> >>> I am working on a vignette for a package that outputs reports for users. >>> As >>> part of the vignette, users can manually run eval=FALSE code that creates >>> example reports. These example reports that they create can be saved to >>> an >>> output folder within extdata (extdata/OutputFolder). >>> >> > > Note that this is a bad idea. > Your users may not have write access to that folder, e.g. for network > wiede installation as the one at my department. > Also, you have to ask users (por let them enter a path or file) before > writing somewhere on the filespace if not tempdir(). > > Best, > Uwe Ligges > > > > > >>> When I submit to CRAN, I will be sure that OutputFolder is empty. >>> However, >>> whenever I make it empty, the entire folder disappears. To combat this >>> problem, I have placed a .gitkeep file within the OutputFolder. >>> >>> I *believe* the presence of the .gitkeep file works as intended (prevents >>> the automatic removal of the OutputFolder when empty). However, upon >>> running check(), I receive a note: >>> >>> *checking for hidden files and directories ... NOTE* >>> *Found the following hidden files and directories:* >>> * inst/extdata/OutputFiles/.gitkeep* >>> *These were most likely included in error. See section ‘Package* >>> *structure’ in the ‘Writing R Extensions’ manual.* >>> >>> Does anyone have advice on how to effectively remove this note? >>> Otherwise, >>> does my rationale above seem like a reasonable purpose for keeping the >>> note? >>> >>> Thank you for helping me approach this! >>> >>> [[alternative HTML version deleted]] >>> >>> __ >>> 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 > [[alternative HTML version deleted]] __ R-package-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-package-devel
Re: [R-pkg-devel] .gitkeep file to prevent folder from erasing when empty
On 03.10.2016 08:13, Johannes Ranke wrote: Hi, You can include the .gitkeep file in .Rbuildignore. This will prevent it from being present in the package you test or submit, but git willl still see it and keep the directory. Johannes Am Montag, 3. Oktober 2016, 00:03:33 schrieb Luck Buttered: Hello everyone: I am working on a vignette for a package that outputs reports for users. As part of the vignette, users can manually run eval=FALSE code that creates example reports. These example reports that they create can be saved to an output folder within extdata (extdata/OutputFolder). Note that this is a bad idea. Your users may not have write access to that folder, e.g. for network wiede installation as the one at my department. Also, you have to ask users (por let them enter a path or file) before writing somewhere on the filespace if not tempdir(). Best, Uwe Ligges When I submit to CRAN, I will be sure that OutputFolder is empty. However, whenever I make it empty, the entire folder disappears. To combat this problem, I have placed a .gitkeep file within the OutputFolder. I *believe* the presence of the .gitkeep file works as intended (prevents the automatic removal of the OutputFolder when empty). However, upon running check(), I receive a note: *checking for hidden files and directories ... NOTE* *Found the following hidden files and directories:* * inst/extdata/OutputFiles/.gitkeep* *These were most likely included in error. See section ‘Package* *structure’ in the ‘Writing R Extensions’ manual.* Does anyone have advice on how to effectively remove this note? Otherwise, does my rationale above seem like a reasonable purpose for keeping the note? Thank you for helping me approach this! [[alternative HTML version deleted]] __ 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