roxygen2 icon indicating copy to clipboard operation
roxygen2 copied to clipboard

`forcats` `%in%` does not link

Open math-mcshane opened this issue 4 months ago • 2 comments

Hello from tidy dev day 2025,

After running

usethis::create_from_github("tidyverse/forcats")
devtools::document()

I got the following message:

ℹ Updating forcats documentation
ℹ Setting RoxygenNote to "7.3.3"
ℹ Loading forcats
✖ match.R:3: @description Could not resolve link to topic "\\%in\\%" in the dependencies or base
  packages.
ℹ If you haven't documented "\\%in\\%" yet, or just changed its name, this is normal. Once "\\%in\\%"
  is documented, this warning goes away.
ℹ Make sure that the name of the topic is spelled correctly.
ℹ Always list the linked package as a dependency.
ℹ Alternatively, you can fully qualify the link with a package name.
Writing forcats-package.Rd

Examining match.R, @hadley noted that it appeared that roxygen2 did not link %in% and to leave this issue here.

#' Test for presence of levels in a factor
#'
#' Do any of `lvls` occur in `f`? Compared to [%in%], this function validates
#' `lvls` to ensure that they're actually present in `f`. In other words,
#' `x %in% "not present"` will return `FALSE`, but `fct_match(x, "not present")`
#' will throw an error.

Or here.

math-mcshane avatar Sep 19 '25 15:09 math-mcshane

This started to occur with b94b42ff (#1633).

mcol avatar Dec 01 '25 19:12 mcol

My workaround is just linking to match() instead:

#' [`%in%`][match()]

jmbarbone avatar Dec 04 '25 18:12 jmbarbone