Install_extras not working?
I am writing an R package and am trying to use the feature .install_extras
described in Writing R Extensions . This document states that: "To install any other files in the vignette directory, include the vignettes / .install_extras file, which defines them as Perl-like regular expressions on one or more lines."
I created this file and contains the following line.
myfile.png
The png file is present in the vignette directory, but when I install the package using devtools::install()
, the file is not copied to the doc / install folder (or inst / doc of the development directory).
I've checked various packages on Github that use this feature (like Rcppzigguart ) and as far as I can tell, it should work.
Any ideas? This is with R 3.1.0.
source to share
I had a similar problem when trying to get the citations file bibliography.bib
located at vignettes/
copied to inst/doc
. This is necessary if you want to use the same quote .bib
file from other documents, such as README.Rmd.
The file is bibliography.bib
not automatically copied to inst/doc
during installation / build / reboot; you must explicitly declare the file .bib
in .install_extras
. Also, you need to run devtools::build_vignettes()
. The file .bib
will then be available in inst/doc
, which will be available to any document in the package using the following:
bib_file <- system.file("doc", "bibliography.bib", package = "myPkg")
...
I use it along with a package knitcitations
when I need to provide a source in a README or an example notebook.
f0nzie
source to share