[R-pkg-devel] dateset with roxygen2?

Spencer Graves @pencer@gr@ve@ @end|ng |rom e||ect|vede|en@e@org
Wed Sep 24 22:32:15 CEST 2025


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>
>



More information about the R-package-devel mailing list