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

reexports.Rd re-writes lubridate functions re-exported #1609

Open
jeffcraggy opened this issue Apr 16, 2024 · 1 comment
Open

reexports.Rd re-writes lubridate functions re-exported #1609

jeffcraggy opened this issue Apr 16, 2024 · 1 comment

Comments

@jeffcraggy
Copy link

jeffcraggy commented Apr 16, 2024

Creating a package with usethis::create_package(), roxygen2 v 7.3.0,

Adding re-exported functions from lubridate in the /R/lubridate.R file:

  #' @export
  #' @importFrom lubridate %m+%
  lubridate::`%m+%`

  #' @export
  #' @importFrom lubridate %m-%
  lubridate::`%m-%`

As shown here: 11.8.2 Re-exporting

The first two times the package is documented devtools::document(), when reexports.Rd is created, it will switch %m+% to %m-% and vice verse.
However, if the package is documented a third time, there is no change, but if the package is checked - devtools::check(), (which writes reexport.Rd again), the bug re-appears and the functions operators switch places in the man pages doc.

Note that the reexports.Rd contents \alias{%m+%} never changes, nor the \link to the function, only the actual symbol changes from + to - and - to +.

Contents reexports.Rd :

% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/reexport.R
\docType{import}
\name{reexports}
\alias{reexports}
\alias{\%m+\%}
\alias{\%m-\%}
\title{Objects exported from other packages}
\keyword{internal}
\description{
These objects are imported from other packages. Follow the links
below to see their documentation.

\describe{
  \item{lubridate}{\code{\link[lubridate:mplus]{\%m-\%}}, \code{\link[lubridate:mplus]{\%m+\%}}}
}}`

\describe{
  \item{lubridate}{\code{\link[lubridate:mplus]{\%m+\%}}, \code{\link[lubridate:mplus]{\%m-\%}}}
}}

After further investigation, it appears that lubridate calls both functions mplus. So perhaps this is a bug with lubridate and not roxygen2?

@jeffcraggy
Copy link
Author

jeffcraggy commented Apr 16, 2024

Oh you know what, I see that %m-%is an alias of%m+% so they are not one-to-one operations.

Perhaps I should only be re-exporting %m+% and omit %m-%?

Thanks - Jeff

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant