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

pkgdown site links as_factor() to forcats::as_factor() instead of haven::as_factor() #26

Open
dtburk opened this issue Mar 6, 2023 · 0 comments

Comments

@dtburk
Copy link
Collaborator

dtburk commented Mar 6, 2023

The value-labels vignette refers to as_factor(), and pkgdown attempts to automatically link this to the appropriate function documentation, but in this case, it links to forcats::as_factor() instead of haven::as_factor(). If the vignette was just referring to a function from an external package, we could just use haven::as_factor() explicitly. However, ipumsr re-exports haven::as_factor() so that ipumsr users don't have to load haven to use it, so it wouldn't be ideal if we had to use haven::as_factor() in the vignette just to get the pkgdown link to work properly.

One partial solution would be to replace references to as_factor() with

[`as_factor()`](https://haven.tidyverse.org/reference/as_factor.html)

in the text of the vignette, but then those links would look different from the links auto-generated by pkgdown, and we would have to manually update the url if haven ever moved its documentation site. Moreover, that approach wouldn't work for code references to as_factor().

It's possible that we should create an issue on pkgdown or downlit requesting a new feature that allows pkgdown users to manually specify which package a function is from for function names that appear in multiple packages, or alternatively, an update that checks for function name matches in re-exported functions before looking more widely.

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