[R-pkg-devel] doi confusion and Data codoc mismatches

Duncan Murdoch murdoch@dunc@n @end|ng |rom gm@||@com
Sun Dec 26 11:55:35 CET 2021


On 26/12/2021 12:07 a.m., Spencer Graves wrote:
> Hello, All:
> 
> 
> 	  The latest checks on
> "https://github.com/sbgraves237/Ecdat/runs/4634725654?check_suite_focus=true"
> identify two problems I don't know how to fix:
> 
> 
> FIRST:  Data codoc mismatches from documentation object 'USnewspapers':
>     Variables in data frame 'USnewspapers'
>       Code: AdsProportion Ads_G2012dollars Ads_currentGdollars
>             Circ_G2012dollars Circ_currentGdollars GDP_G2012 GDP_nominalG
>             Population_M RevenuePerCap_2012 RevenuePerCap_nominal
>             Revenue_G2012dollars Revenue_currentGdollars Year
>             newspapers_p_GDP
>       Docs: Ads_G2012dollars Circ_G2012dollars Circ_currentGdollars
>             Revenue_G2012dollars Revenue_currentGdollars AdsProportion
>             Ads_currentGdollars GDP_G2012 GDP_nominalG Population_M
>             RevenuePerCap_2012 RevenuePerCap_nominal Year newspapers_p_GDP
> 
> 
> 	  I believe that the column names in the data.frame 'USnewspapers'
> match the names in the order given in the *.Rd file and the variable
> list following "Code" here matches that following "Docs" using, e.g.,
> sort(scan(what=character())).

You can debug this by running tools::codocData("Ecdat") after the 
package is installed.  It appears that some of the names in the docs are 
picking up newlines, specifically the ones documented like this:

\item{Ads_currentGdollars,
           Ads_G2012dollars,
           Circ_currentGdollars,
           Circ_G2012dollars,
           Revenue_currentGdollars,
           Revenue_G2012dollars}

I think that's a bug in codocData.  A workaround is to put those all on 
one line.  You don't get a "line too long" warning, because they'll be 
reformatted in the display.

> 
> 
> SECOND:  Found the following URLs which should use \doi (with the DOI
> name only):
>       File 'AccountantsAuditorsPct.Rd':
>         https://doi.org/10.18128/D010.V8.0
>       File 'OCC1950.Rd':
>         https://doi.org/10.18128/D010.V10.0
> 
> 
> 	  My concern here is that these two urls are in, e.g.,
> \href{https://doi.org/10.18128/D010.V8.0}{text to display to click to
> link to the doi url}.  If it were, e.g.,
> \url{https://doi.org/10.18128/D010.V8.0} I would try replacing it with
> \doi{10.18128/D010.V8.0}.  However, if I do that, I don't know what to
> do with the "text to display to click to link to the doi url".

The first of those links to a page with this version of the reference:

Steven Ruggles, Sarah Flood, Ronald Goeken, Josiah Grover, Erin Meyer, 
Jose Pacas, and Matthew Sobek. Integrated Public Use Microdata Series: 
Version 8.0 [dataset]. Minneapolis: University of Minnesota, 2018. 
http://doi.org/10.18128/D010.V8.0


You'd get a format pretty close to that if you don't try to make the 
title into a link, just enter it as

   Steven Ruggles, Sarah Flood, Ronald Goeken,
     Josiah Grover, Erin Meyer, Jose Pacas, and
     Matthew Sobek (2018)
IPUMS
     USA: Version 8.0 [dataset]. Minneapolis, MN:
     IPUMS. \doi{10.18128/D010.V8.0}

Duncan Murdoch



More information about the R-package-devel mailing list