HenrikBengtsson / R.rsp

:page_facing_up: R package: Dynamic generation of scientific reports
https://henrikbengtsson.github.io/R.rsp/
31 stars 6 forks source link

Static PDF vignette only available through browseVignettes("packagename"), and not help("packagename") #54

Closed alexpate30 closed 5 months ago

alexpate30 commented 6 months ago

I am using R.rsp to include a static vignette in an R package being developed. The vignette is not available through help("packagename"), although it can be accessed through browseVignettes("packagename").

I have tested this using R.rsp as well, and I think the same thing is happening. After running help(package = "R.rsp"), navigate to "User guides, package vignettes and other documentation". Clicking on the "R.rsp::R_packages_Static_PDF_and_HTML_vignettes" file returns an error. Same is true for all the PDF vignettes, but not the HTML ones.

Accessing the vignettes through browseVignettes(package = "R.rsp"), all vignettes can be accessed. Is anyone else able to reproduce this error? Any idea why this might be happening?

HenrikBengtsson commented 6 months ago

Thanks for reporting. Works for me on Ubuntu 22.04 Linux running R 4.4.0;

> install.packages("R.rsp")
...
> help(package = "R.rsp")

After this, I can navigate to the vignettes, and clicking on 'PDF' for the different vignettes opens the vignette.

Are you using devtools or similar to install your packages? If so, maybe that's it.

> sessionInfo()
R version 4.4.0 (2024-04-24)
Platform: x86_64-pc-linux-gnu
Running under: Ubuntu 22.04.4 LTS

Matrix products: default
BLAS:   /home/henrik/shared/software/CBI/_ubuntu22_04/R-4.4.0-gcc11/lib/R/lib/libRblas.so 
LAPACK: /usr/lib/x86_64-linux-gnu/lapack/liblapack.so.3.10.0

locale:
 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C              
 [3] LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8    
 [5] LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8   
 [7] LC_PAPER=en_US.UTF-8       LC_NAME=C                 
 [9] LC_ADDRESS=C               LC_TELEPHONE=C            
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C       

time zone: America/Los_Angeles
tzcode source: system (glibc)

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] R.rsp_0.46.0

loaded via a namespace (and not attached):
[1] compiler_4.4.0    tools_4.4.0       R.methodsS3_1.8.2 digest_0.6.35    
[5] R.cache_0.16.0    R.utils_2.12.3    R.oo_1.26.0      
alexpate30 commented 6 months ago

Thank you for the response. Can confirm I have installed from CRAN as opposed to using devtools.

After running some more tests, I was able to load the vignettes through help(package = "R.rsp") when running R for windows without R studio.

> sessionInfo()
R version 4.3.2 (2023-10-31 ucrt)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 19045)

Matrix products: default

locale:
[1] LC_COLLATE=English_United Kingdom.utf8 
[2] LC_CTYPE=English_United Kingdom.utf8   
[3] LC_MONETARY=English_United Kingdom.utf8
[4] LC_NUMERIC=C                           
[5] LC_TIME=English_United Kingdom.utf8    

time zone: Europe/London
tzcode source: internal

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

loaded via a namespace (and not attached):
[1] compiler_4.3.2 tools_4.3.2   

When submitting the same command help(package = "R.rsp") from within Rstudio (same version of R), I was unable to access the vignette. The sessionInfo() was identical. I was using version:

RStudio 2023.06.1+524 "Mountain Hydrangea" Release (547dcf861cac0253a8abb52c135e44e02ba407a1, 2023-07-07) for windows
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) RStudio/2023.06.1+524 Chrome/110.0.5481.208 Electron/23.3.0 Safari/537.36

Interestingly, when repeating the test using an older version of RStudio on a computer cluster I have access to, I was also able to view the vignettes using this approach. I therefore updated Rstudio on my local computer to the newest version,

RStudio 2024.04.1+748 "Chocolate Cosmos" Release (3ada7c6ddc8fcdb86a727a4f0ae467b9d9a7296c, 2024-05-07) for windows
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) RStudio/2024.04.1+748 Chrome/120.0.6099.291 Electron/28.2.6 Safari/537.36, Quarto 1.4.553

and it is now working on there too. Seems like whatever the bug was, was restricted to that version of RStudio.

Thank you for your help.

HenrikBengtsson commented 5 months ago

Thanks for reporting back. Good that you sorted it out.