[R-pkg-devel] dateset with roxygen2?
Spencer Graves
@pencer@gr@ve@ @end|ng |rom e||ect|vede|en@e@org
Thu Sep 25 10:08:37 CEST 2025
Diego Hernangómez Herrero identified my problem:
My .Rbuildignore file in the package root directory contained
'MaddisonCountries.rda'. I thought that entry in .Rbuildignore would
apply only to the a copy in the package root directory and would not
affect the copy in data. Clearly I was wrong.
The code in my vignette only generates that file when there's an
appropriately named *.xlsx file in inst/exdata. Both the *.xlsx and
*.rda files are in .gitignore and so are not on GitHub. That trick means
that the vignette does not write anything on standard checks on GitHub,
CRAN, etc.
I can accomplish the same thing without this problem and still have the
vignette work as intended by writing the new data file with a different
name. The file would then have to be renamed before replacing the old
file in data/ with the new.
Thanks again to Diego Hernangómez Herrero and thanks to all others who
spent time looking at this and thinking about it.
Sincerely,
Spencer Graves
On 9/24/25 19:01, Spencer Graves wrote:
> Hi, John:
>
>
> On 9/24/25 16:27, John Benninghoff wrote:
>> Hi Spencer, I tried downloading your GitHub repo. I wasn’t able to
>> replicate your R CMD check results. I did find issues with the
>> DESCRIPTION file, which I fixed by removing the blank “Imports” and
>> running desc::desc_normalize(). After that, running
>> rcmdcheck::rcmdcheck() returned 0 errors, warnings, and notes.
>
>
> Thanks.
>
>
> I got what you got with "rcmdcheck::rcmdcheck()".
>
>
> Sadly, GitHub Actions still reported the previous warning after I
> committed the change you suggested to DESCRIPTION AND locally using the
> process I found recommended in "R Projects":
>
>
> library(devtools)
> document() # add
> load_all()
> check()
>
>
> I'm currently trying to develop a toy package using roxygen2:
>
>
> https://github.com/sbgraves237/roxygenData1
>
>
> This toy package currently consists only of boilerplate with zero content.
>
>
> Thanks for your help. roxygen2 sounds great, but it cannot be used if a
> problem like this cannot be fixed with a finite amount of effort ;-)
>
>
> Spencer
>
>>
>>> On Sep 24, 2025, at 3:32 PM, Spencer Graves
>>> <spencer.graves using effectivedefense.org> wrote:
>>>
>>> Hi, Michael et al.:
>>>
>>>
>>> On 9/24/25 11:59, Michael Chirico wrote:
>>>> {ggplot2} has a number of data sets, you might read over their sources:
>>>> https://github.com/tidyverse/ggplot2/blob/main/R/data.R <https://
>>>> github.com/tidyverse/ggplot2/blob/main/R/data.R>
>>>
>>>
>>> Thanks. I don't see anything there that is different from the example
>>> in their book, which is extracted from the similar data.R file in
>>> their tidyr package, which I reviewed earlier.[2]
>>>
>>>
>>> I've deleted virtually everything else in that package and still get
>>> that same error.
>>>
>>>
>>> Suggestions?
>>> Spencer Graves
>>>
>>>
>>> p.s. I've done several web searches on this issue, found discussions
>>> on StackOverflow that may have worked a few years ago, but roxygen2
>>> seems to have changes since then. I posted a similar question to
>>> StackOverflow, that generated a few comments but nothing that seemed
>>> to fix this problem. I reported an "issue" to the R Packages book on
>>> GitHub last week, so far with nothing:
>>>
>>>
>>> https://github.com/hadley/r-pkgs/issues/1106
>>>
>>>
>>> I tried to use roxygen2 with a different project a year ago and gave
>>> up after being unable to figure out how to use it. >
>>>> On Wed, Sep 24, 2025 at 5:48 AM Spencer Graves
>>>> <spencer.graves using effectivedefense.org
>>>> <mailto:spencer.graves using effectivedefense.org>> wrote:
>>>> Hello, All:
>>>> How does one document a dataset with roxygen2?
>>>> I've recently read Wickham and Bryan, R Packages (2e).[1] I've
>>>> tried to
>>>> do what they say there, and R CMD check is reporting:
>>>> Variables with usage in Rd file 'MaddisonCountries.Rd' but
>>>> not in
>>>> code:
>>>> ‘MaddisonCountries’
>>>> This is in "https://github.com/sbgraves237/SS4Maddison <https://
>>>> github.com/sbgraves237/SS4Maddison>".
>>>> Suggestions? Thanks, Spencer Graves
>>>> p.s. Wickham and Bryan Section 7.1.2 says, "Objects in data/ are
>>>> always
>>>> effectively exported .... . This means that they must be
>>>> documented. ...
>>>> [Y]ou document the name of the dataset and save it in R/. For
>>>> example,
>>>> the roxygen2 block used to document the who data in tidyr is
>>>> saved in
>>>> R/data.R ... . There are two roxygen tags that are especially
>>>> important
>>>> for documenting datasets: @format ... @source
>>>> They give an example of a "who" dataset in tidyr. I've studied that
>>>> example without finding what I'm doing wrong.[2]
>>>> In addition, I need to specify Roygen and "LazyData: true" in
>>>> DESCRIPTION.
>>>> [1] Wickham and Bryan, R Packages online at:
>>>> https://r-pkgs.org/ <https://r-pkgs.org/>
>>>> Chapter 7 deals with Data:
>>>> https://r-pkgs.org/data.html <https://r-pkgs.org/data.html>
>>>> [2] "data.R" in tidyr is available at:
>>>> https://github.com/tidyverse/tidyr/blob/main/R/data.R <https://
>>>> github.com/tidyverse/tidyr/blob/main/R/data.R>
>>>> ______________________________________________
>>>> R-package-devel using r-project.org <mailto:R-package-devel using r-
>>>> project.org>
>>>> mailing list
>>>> https://stat.ethz.ch/mailman/listinfo/r-package-devel <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
>>
>
> ______________________________________________
> R-package-devel using r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-package-devel
More information about the R-package-devel
mailing list