Adding a vignette stops devtools::check() from working
Asked Answered
T

0

6

I've been writing a personal package with reference to Hadley's guide. However, adding a minimal vignette using devtools::use_vignette() seems to break devtools::check().

When I try to run check() I get one error:

file 'C:/path/temp/package/DESCRIPTION' is not in valid DCF format

and one warning:

In read.dcf(dfile, keep.white = .keep_white_description_fields) :
  cannot open compressed file 'C:/path/temp/package/DESCRIPTION', probable reason 'Permission denied'

I can successfully run devtools::check() if I delete the vignettes folder and devtools::build_vignettes() runs ok.

Edited to add: I wondered if this was an issue with trying run check from a network location, but I copied the project to C:\R\package_name and it still returns the same error.

Curiously, this does appear to be machine dependent as I get the above error on my work machine, but not on my personal laptop. Work machine is win7, personal win10.

DESCRIPTION is copied below

Package: pkg_nm
Type: Package
Title: A title
Version: 0.0.0.9000
Authors@R: person("name", "name", email = "[email protected]", role = c("aut", "cre"))
Description: Functions for working with data from my source.
License: OGL
LazyData: TRUE
RoxygenNote: 5.0.1
URL: [url here]
BugReports: [url here]
Imports:
    lubridate,
    stringr,
    dplyr,
    lazyeval,
    magrittr
Collate:
    'my_function.R'
Suggests: knitr,
    rmarkdown
VignetteBuilder: knitr
Thorstein answered 14/4, 2016 at 11:14 Comment(7)
What is the error message when you do read.dcf(file = "DESCRIPTION")?Mcginnis
There is no error message when I do read.dcf(). It prints the contents of the DCF to the console.Thorstein
However, if I try to do read.dcf() on the tempfile location returned in the error above I get: Error in read.dcf(file = "C:/Users/r.bot/AppData/Local/Temp/RtmpcLoGrg/Rbuild1f4069c1632e/package/DESCRIPTION") : cannot open the connection In addition: Warning message: In read.dcf(file = "C:/Users/r.bot/AppData/Local/Temp/RtmpcLoGrg/Rbuild1f4069c1632e/package/DESCRIPTION") : cannot open compressed file 'C:/Users/r.bot/AppData/Local/Temp/RtmpcLoGrg/Rbuild1f4069c1632e/package/DESCRIPTION', probable reason 'No such file or directory'Thorstein
I see RoxygenNote 5.0.1, but we're at 6.0.1 now. Did you try to first update roxygen2 and devtools? I've noticed before that when you have conflicting versions of these packages, they don't always work nicely together. It might be that either devtools or roxygen2 messes up the DESCRIPTION file when building the vignettes.Apograph
@JorisMeys thanks, I've updated both to the latest cran versions and get the same error message. I can't do library(devtools) build_github_devtools() #### Restart R before continuing #### install.packages("devtools.zip", repos = NULL, type = "source") as described here cran.r-project.org/web/packages/devtools/README.html beacuse I'm stuck behind a corporate firewall.Thorstein
@Thorstein the latest CRAN versions should be OK.Apograph
@JorisMeys, thanks, so it's not that then.Thorstein

© 2022 - 2024 — McMap. All rights reserved.