[R-pkg-devel] URLencode at DESCRIPTION file and citation()

Jeff Newmiller jdnewm|| @end|ng |rom dcn@d@v|@@c@@u@
Tue Nov 3 14:10:15 CET 2020


Section 2.1 of the Writing R Extensions manual points out that percent symbols must (practically) always be escaped in Rd files. This includes within URLs.

On November 3, 2020 2:08:05 AM PST, "Maëlle SALMON via R-package-devel" <r-package-devel using r-project.org> wrote:
>Hello,
>
>1) I found (via GitHub search for DOIs in DESCRIPTION
>files https://github.com/search?q=org%3Acran+%3Cdoi+user%3Acran+filename%3ADESCRIPTION&type=Code&ref=advsearch&l=&l=)
>a package with an URL-encoded DOI see
>https://github.com/cran/clust.bin.pair/blob/e464ac7e5d094bffd25b7c4cbba67820b60f1cc1/DESCRIPTION
>and the resulting CRAN page
>https://cran.r-project.org/web/packages/clust.bin.pair/index.html So I
>think you are right to use URL encoding.
>
>I can reproduce the problem you get with the roxygen2-generated
>package-level manual page. The problem is that when going from Rd to
>HTML, the parts after "%" are ignored indeed. I'm not sure at what
>level this should be fixed. I opened an issue in roxygen2
>https://github.com/r-lib/roxygen2/issues/1164 I hope others will have
>more useful answers. :-)
>
>2) For that aspect I looked into a CITATION file I knew
>https://github.com/ropensci/bomrang/blob/master/inst/CITATION
>
>For finding the version it uses meta$Version. So your CITATION could
>e.g. become
>
>citHeader("To cite raytracing in publications use at least the first,
>if not both:")
>
>year <- sub("-.*", "", meta$Date)
>note <- sprintf("R package version %s", meta$Version)
>
>citEntry(entry = "manual",
>   title          = "raytracing: An R package for identification and
>tracking the atmospheric Rossby waves",
>   author         = personList(c(person("Amanda", "Rehbein"),
>                    person("Tercio", "Ambrizzi"),
>                    person("Sergio", "Ibarra-Espinosa"),
>                    person("Livia M. M.", "Dutra"))),
>   year           = year,
>   url            = "https://github.com/salvatirehbein/raytracing",
>   note          = note,
>   textVersion  =
>   paste0("Rehbein, A., Ambrizzi, T., Ibarra-Espinosa, S., Dutra, L. M.
>M.: Rossby Wave Ray Tracing v", meta$Version, ".
>https://github.com/salvatirehbein/raytracing, ", year,".")
>)
>
>citation(auto = meta)
>
>citFooter("Thanks")
>
>Maëlle.
>
>
>Den söndag 1 november 2020 21:29:54 CET, Amanda Rehbein
><amanda.rehbein using usp.br> skrev: 
>
>
>
>
>
>Dear R-Devs,
>
>I was wondering if someone could please help me to with two errors when
>submitting a package to CRAN.
>
>1) At the DESCRIPTION file I added some DOI's with curled brackets "<>"
>inside the "<>" (e.g.
><doi:10.1175/1520-0469(1981)038<1179:TSLROA>2.0.CO;2>).
>I tried URLencode() the string in R and copy/paste the output into
>the DESCRIPTION file, like this:
><doi:10.1175/1520-0469(1981)038%3C1179:TSLROA%3E2.0.CO;2>. But when I
>load,
>build, check, etc, and ?raytracing the DOI does not appear correctly.
>Everything after the first "%" disappeared and obviously, the DOI
>doesn't
>work anymore.
>
>
>2) I have a CITATION file at the sub-directory ins. Its content is like
>this:
>
>citHeader("To cite raytracing in publications use one of below:")
>
>citEntry(entry = "manual",
>  title          = "Atmospheric Rossby waves identification and
>tracking
>with a raytracing numerical model",
>  author        = personList(c(person("Amanda", "Rehbein"),
>                    person("Tercio", "Ambrizzi"),
>                    person("Sergio", "Ibarra-Espinosa"),
>                    person("Livia M. M.", "Dutra"))),
>  year          = "2020",
>  url            = "https://github.com/salvatirehbein/raytracing",
>
>  textVersion  =
>  paste0("Rehbein, A., Ambrizzi, T., Ibarra-Espinosa, S., Dutra, L. M.
>M.:
>Atmospheric Rossby waves identification and tracking with a raytracing
>numerical model ", packageVersion("raytracing"), ".
>https://github.com/salvatirehbein/raytracing, 2020.")
>)
>
>It passes all checks and gives a-okay citation when I type
>citation("raytracing"). However, it fails in the CRAN tests with the
>following error message.
>
>Reading CITATION file fails with
>    there is no package called 'raytracing'
>  when package is not installed.
>
>I will be very thankful for any help with this! Best,
>Amanda
>
>    [[alternative HTML version deleted]]
>
>______________________________________________
>R-package-devel using r-project.org mailing list
>https://stat.ethz.ch/mailman/listinfo/r-package-devel
>
>______________________________________________
>R-package-devel using r-project.org mailing list
>https://stat.ethz.ch/mailman/listinfo/r-package-devel

-- 
Sent from my phone. Please excuse my brevity.



More information about the R-package-devel mailing list