Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invalid @usage section generated for data objects when LazyData: false is set #1425

Open
DavisVaughan opened this issue Aug 31, 2022 · 1 comment
Labels
feature a feature request or enhancement rd ✍️

Comments

@DavisVaughan
Copy link
Member

This stack overflow answer of mine continue to get upvotes, so I think this is probably a roxygen2 bug
https://stackoverflow.com/questions/57396392/warning-variables-with-usage-in-documentation-object-fang-but-not-in-code/57396393#57396393

When LazyData: false is set and you have a data object, then roxygen2 generates an invalid @usage section that check() complains about with the following warning:

checking for code/documentation mismatches ... WARNING
  Variables with usage in documentation object 'mydata' but not in code:mydata

The usage section that gets generated looks like:

\usage{
mydata
}

but to be valid when LazyData: false is set, it should be something like:

\usage{
data(mydata)
}

I've created a test package for this bug:
https://github.com/DavisVaughan/testroxygen2usage

It is currently in a state where things are broken, i.e. check() gives that warning. It has LazyData: false set and a documented data set, mydata, in mydata.R. You can manually "fix" it in two ways:

  • Set LazyData: true
  • Manually override usage with @usage data(mydata)
@hadley hadley added feature a feature request or enhancement rd ✍️ labels Nov 2, 2023
@AliSajid
Copy link

Bumping this issue since this is still a problem and BioConductor requires us to set LazyData to false.

PeteHaitch added a commit to PeteHaitch/PRONE that referenced this issue Aug 22, 2024
- To avoid `R CMD check` complaining, following advice in r-lib/roxygen2#1425
- roxygenise
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature a feature request or enhancement rd ✍️
Projects
None yet
Development

No branches or pull requests

3 participants