[R-pkg-devel] dateset with roxygen2?
Michael Chirico
m|ch@e|ch|r|co4 @end|ng |rom gm@||@com
Wed Sep 24 18:59:24 CEST 2025
{ggplot2} has a number of data sets, you might read over their sources:
https://github.com/tidyverse/ggplot2/blob/main/R/data.R
On Wed, Sep 24, 2025 at 5:48 AM Spencer Graves <
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".
>
>
> 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/
>
>
> Chapter 7 deals with Data:
>
>
> https://r-pkgs.org/data.html
>
>
> [2] "data.R" in tidyr is available at:
>
>
> https://github.com/tidyverse/tidyr/blob/main/R/data.R
>
> ______________________________________________
> R-package-devel using r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-package-devel
>
[[alternative HTML version deleted]]
More information about the R-package-devel
mailing list