Open dtburk opened 4 months ago
Would href_topic("as_factor.labelled", package = "haven", is_fun = TRUE)
work? Or do you need this to happen automatically when downlit
sees as.factor
?
Thanks for the quick reply!
Ideally it would happen automatically, so that we can just call as_factor()
in example code in a vignette, and have the auto-generated link on our pkgdown website point to the haven documentation.
Since our use case for downlit is through pkgdown, I'm imagining that this feature, were it ever created, might require tweaks to both pkgdown and downlit (e.g. a new field in _pkgdown.yml specifying that as_factor()
should be treated as haven:::as_factor.haven_labelled()
).
Package ipumsr re-exports
haven::as_factor()
to give users easy access to the S3 methodhaven:::as_factor.haven_labelled()
defined in haven. However, since the generic is defined in forcats, downlit links references toas_factor()
in ipumsr documentation to theforcats::as_factor()
documentation (see reprex below).Created on 2024-07-08 with reprex v2.1.1
This autolinking behavior is technically correct, but it would be useful if there was an option for ipumsr developers to specify that we want calls to
as_factor()
to link to the haven documentation, since that is more relevant to our users.