ISAAKiel / mortAAR

R Package - Analysis of Archaeological Mortality Data
GNU General Public License v3.0
14 stars 0 forks source link

File .csl not found in resource path #61

Closed nmueller18 closed 1 year ago

nmueller18 commented 2 years ago

In the latest CRAN-tests, there surfaced an error in the processing of the references in the vignettes via pandoc. It has to be fixed by 2022/05/06:

Check: re-building of vignette outputs 
Result: ERROR 
    Error(s) in re-building vignettes:
    --- re-building 'mortAAR_vignette-1.Rmd' using rmarkdown
    File .csl not found in resource path
    Error: processing vignette 'mortAAR_vignette-1.Rmd' failed with diagnostics:
    pandoc document conversion failed with error 99
    --- failed re-building 'mortAAR_vignette-1.Rmd'
Error: Vignette re-building failed.
    Execution halted 
Flavor: [r-release-windows-x86_64]

A Google-search did not bring up obvious solutions. The error probably implies that pandoc cannot access the csl-file linked in the vignettes. The error only occurs on the test Windows system, but also on my Mac the command RCurl::url.exists('https://www.zotero.org/styles/offa') used in the vignettes returns FALSE, which of course leaves the text string "r library(RCurl); ifelse(url.exists('https://www.zotero.org/styles/offa'), 'https://www.zotero.org/styles/offa', '')" empty. The corresponding command of the package httr httr::GET('https://www.zotero.org/styles/offa') strangely returns Error in curl::curl_fetch_memory(url, handle = handle) : SSL certificate problem: certificate has expired. However, a test of the address yielded a valid certificate. Increasing the connecttimeout setting of RCurl did not help, either. I am puzzled. One possible solution seems to bundle a copy of the offa-csl-file with the package but this would defy the whole idea of csl-styles somehow. Any other ideas?

MartinHinz commented 2 years ago

I am puzzled, too, because at my (linux) system, it looks like this: image

I suggest removing the csl: "r library(RCurl); ifelse(url.exists('https://www.zotero.org/styles/journal-of-archaeological-science'), 'https://www.zotero.org/styles/journal-of-archaeological-science', '')"` alltogether, to avoid that error. What do you think?

nmueller18 commented 2 years ago

But in this case the csl-file has to be bundled with the package, or am I wrong?

MartinHinz commented 2 years ago

We do not need the csl, or only, if we want to display that style, I suppose.

nmueller18 commented 2 years ago

The style is used by pandoc for knitting the vignettes, as far as I know.

MartinHinz commented 2 years ago

That might be true, but we could go without. Than, the references would look like this: image

Compare to the current one at the vignette on CRAN: image

https://cran.r-project.org/web/packages/mortAAR/vignettes/mortAAR_vignette-1.html

I do not think this is a dramatic loss.

nmueller18 commented 2 years ago

Ah, in this case, the line should go, as this is the easiest solution. I will prepare a new version.

nmueller18 commented 1 year ago

Fixed in version 1.1.2.