kevinwolz / hisafer

An R toolbox for the Hi-sAFe biophysical agroforestry model
6 stars 4 forks source link

R can't find the vignette for hisafer #132

Closed mariegosme closed 4 years ago

mariegosme commented 4 years ago

Although the package folder contains the vignette (R/3.6/library/hisafer/doc/hisafer-vignette.pdf), the vignette cannot be opened through R : vignette("hisafer-vignette") Warning message: vignette ‘hisafer-vignette’ introuvable and vignette(package="hisafer") no vignettes found

Any idea why R can't find the vignette? Thank you Marie

kevinwolz commented 4 years ago

@mariegosme, I'm sorry that I didn't see all these issues. For some reason, I have stopped getting notifications from my own GitHub account! I just took a quick look at this and it looks like the vignette failed to build last time I built the package because of some bug, so it didn't put the html file into the package. I need to fix the bug first and then rebuild the vignette. Working on it!

kevinwolz commented 4 years ago

Actually, it seems like the real issue may be something to do with devtools::install_gitub(). Is that how you received your current version of hisafer?

Regardless, if you want the vignette to be inside of R, you need to install hisafer with this extra argument in install_github(). By default it does not build vignettes to save time. This wouldn't be an issue if installing a binary package from CRAN, but we aren't ready to submit to CRAN yet!

devtools::install_github("kevinwolz/hisafer", build_vignettes = TRUE)

mariegosme commented 4 years ago

Hi Kevin, thank you very much for all the bug fixes today, you've been very active ! For this one, using the argument build_vignettes did not work: creating vignettes (36.2s) --- re-building ‘hisafer-vignette.Rmd’ using rmarkdown Quitting from lines 366-367 (hisafer-vignette.Rmd) Error: processing vignette 'hisafer-vignette.Rmd' failed with diagnostics: there is no package called 'egg' --- failed re-building ‘hisafer-vignette.Rmd’

SUMMARY: processing the following file failed: ‘hisafer-vignette.Rmd’

Erreur : Vignette re-building failed. Exécution arrêtée Erreur : Failed to install 'hisafer' from GitHub: System command error, exit status: 1, stdout + stderr (last 10 lines): E> Quitting from lines 366-367 (hisafer-vignette.Rmd) E> Error: processing vignette 'hisafer-vignette.Rmd' failed with diagnostics: E> there is no package called 'egg' E> --- failed re-building ‘hisafer-vignette.Rmd’ E> E> SUMMARY: processing the following file failed: E> ‘hisafer-vignette.Rmd’ E> E> Erreur : Vignette re-building failed. E> Exécution arrêtée

kevinwolz commented 4 years ago

You need to install the egg package. The vignette uses some of the "suggests" packages, not just the "imports". Again, install_github() doesn't automatically take care of this. You can add the argument "dependencies = TRUE" and then it should check and install (or at least ask you if you want to install) any missing packages.

So the full call would be : devtools::install_github("kevinwolz/hisafer", build_vignettes = TRUE, dependencies = TRUE)

I've added a line about this to the vignette to explain this, though this is kind of ironic since this is about installing the vignette in the first place! However, I hope that most people will be starting out with hisafer with the PDF version of the vignette in their hands, and then they can continue from there.