9

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?

Bryan Hanson
  • 6,055
  • 4
  • 41
  • 78
Henk
  • 3,634
  • 5
  • 28
  • 54
  • Installed vignette are located in the `doc` sub-folder of the package. For example if the `dplyr` package is installed on your system, you can see the vignette path with `system.file("doc", package="dplyr")`. This works for any packages which contains a `doc` folder. – Paul Rougieux Jul 28 '17 at 14:23
  • what about using another function: build_manual(path=getwd()) – Ferroao Aug 18 '19 at 17:39

3 Answers3

3

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.

jasmyace
  • 101
  • 1
  • 7
  • it was there! And in fact when I run `check(manual = TRUE)` I now notice that it prints the filepath to the console, in this case `* using log directory 'C:/Users/USERNAME/AppData/Local/Temp/Rtmp0cpWCn/PACKAGENAME.Rcheck'.` So I can just paste that into my Windows explorer navigation bar and I see the .pdf manual. – Sam Firke Oct 12 '16 at 12:35
0

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").

Bryan Hanson
  • 6,055
  • 4
  • 41
  • 78
  • I have found the string "mypackage.Rcheck in the INDEX file that was located in a subfolder of the hidden folder .Rproj.user. There was no [pdf] file. I have installed the package, vignette("mypackage") does not work. – Henk May 01 '15 at 08:24
  • Someone with knowledge of how `devtools` does this will have to answer then. If you are comfortable just using the command line, you can go to the directory above the package directory, and do `R CMD build mypackage`, then `R CMD check mypackage_1.0.0.tar.gz` and then `R CMD install mypackage_1.0.0.tar.gz` and assuming there are no errors at each step, you should have what you want. – Bryan Hanson May 01 '15 at 08:28
  • Check [here](http://stackoverflow.com/a/22313712/633251) too. There may be RStudio settings affecting the outcome. – Bryan Hanson May 01 '15 at 08:56
  • Followed your steps on the command line [R CMD install also needed a target directory]. All successful, but no vignette or PDF manual to be seen. – Henk May 01 '15 at 08:59
  • So if you are in a directory "mypkgs" which has a directory in it called "mypackage" there should now be "mypackage.Rcheck" directory at the same level which should contain a couple of directories and several files, one of which is "mypackage-manual.pdf". It's not there? Do you have any Rprofile type files that might be redirecting output? I wonder if even though you built and checked in the simplest way if some files written by RStudio are still controlling what happens. – Bryan Hanson May 01 '15 at 09:05
  • Grep'd *Rcheck* in both ~/home/user/R and the place where I wrote the package. Nada. Checked the book "R Packages" written by someone who knows about packages and works at RStudio [Hadley] - could not find info. – Henk May 01 '15 at 09:32
  • I'm stumped then. I added an RStudio tag to the question to add to the number of folks who will look at it. They may all be sleeping right now! – Bryan Hanson May 01 '15 at 09:34
  • indeed...the time of the day when posting a SO question is a factor. Thanks for your help...! I did check the Tools/Project Options/Build Tools as well, including configure. – Henk May 01 '15 at 10:05
  • A final thought: when you were using the RStudio approach, did you also check the package? The command would be `devtools::check(...)` or maybe there is a pull down menu. You only mentioned `build` (and the docs say `check` does both). Long shot; I'm still basically stumped. RStudio and R totally up to date? – Bryan Hanson May 01 '15 at 12:09
  • Yes, built and checked. When I used the R CMD [see above] there was also a long check that ended successfully ["R CMD check succeeded"]. – Henk May 01 '15 at 15:22
0

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.

lbusett
  • 5,801
  • 2
  • 24
  • 47