Package development : location of pdf manual and v

2019-04-07 16:40发布

问题:

When building mypackage, everything seems to work:

library(devtools)
build(vignettes = T, manual = T)

* checking for file ‘/storage/Documents/client/validate/mypackage/DESCRIPTION’ ... OK
* preparing ‘mypackage’:
* checking DESCRIPTION meta-information ... OK
* installing the package to build vignettes
* creating vignettes ... OK
* checking for LF line-endings in source and make files
* checking for empty or unneeded directories
* building ‘mypackage_0.1.tar.gz’

[1] "/storage/Documents/client/validate/mypackage_0.1.tar.gz"

However I can't find neither the PDF manual nor the vignette.

Vignette: followed workflow as described here, using RStudio / devtools / markdown. However:

vignette("mypackage") Warning message: vignette ‘mypackage’ not found

For the PDF manual I have tried this, but no success.

So, my question is: where can I find the PDF manual and the vignette?

回答1:

I can find my PACKAGE-manual.pdf, where throughout PACKAGE is my package name, by first going to

C:\Users\USERNAME\AppData\Local\Temp\

within the Windows folder directory. You may have to enable hidden folders and files to see this. Within this folder are many many temp folders and other such things. Sort by date, and scroll down to where the folders are. The most recent one is the one you probably want; the ones that prefix with a "Rtmp" are the ones created by R.

Within the (probably) most recent Rtemp[blah] should be a folder entitled PACKAGE.Rcheck. In that PACKAGE.Rcheck folder should be the manual pdf PACKAGE-manual.pdf, assuming it was successfully created.

The full path string on my computer (for this package-creation run) is

C:\Users\USERNAME\AppData\Local\Temp\RtmpG0713j\PACKAGE.Rcheck\PACKAGE-manual.pdf.

You might have to search through a couple of Rtmp[blah] folders before you get the right one.



回答2:

Not sure quite where RStudio puts it, but in a bare bones check operation the pdf version of the manual should be in a folder called mypackage.Rcheck If you created a mypackage-package.R file then when the package is installed, ?mypackage should lead you to the html version of the manual. The vignette you can get by installing your package and doing vignette("mypackage").



回答3:

I don't know for the manual, but if you build from rstudio using the 'build and reload' button (nearby the check buttonl, the vignettes, if properly built, should end up in 'yourpackage' subfolder of your r library folder, i think in inst/doc sub sub folder. Also, for vignettes did you try building them using devtools::build_vignettes ? Usually works for me.