and it provides exactly the results I want. But when I run CHECK, I get back this NOTE:
getUserDropdownSafetyObservation: no visible global function definition for ':=' Undefined global functions or variables: :=
What's the trick to rectifying this note without use of globalVariables? I tried searching for solutions for about 20 minutes, but ":=" doesn't seem to be a very good search term.
:= is a left-over assignment symbol from earlier R/S days. Be default it currently has no implementation. Packages such as data.table, and wrapr define their own versions, but these are not available until you call library(pkg). I think dplyr just uses the presence of the symbol in unparsed expressions (so does not need an actual implementation) and currently does not export :=.
I think you can get around the check with something like the following (just loose in your package, and don't bother to export it).
`:=` <- function(a,b) {stop(":= should not be called directly")}
Then code such as the following still works (as dplyr either uses its own package definition, or more likely never executes the user code in the first place).
dplyr::mutate(data.frame(x = 1:2), y := x + 1)
The above is safe code, and turns off a minimum number of checks.
By the way wrapr defines := as assigning names, which is very close to how a user sees := being used in other packages. For example.
Another option is to use utils::globalVariables() to declare the symbol. Importing the operator from rlang has the advantage that if you use := in a wrong place you will get an informative error. We unfortunately don't have this luxury with !! as it is not a real operator.