Closed dereksonderegger closed 1 year ago
Hi @dereksonderegger ,
That note comes from the tidyverse. You should follow the recommendation and the note will go away, eg all_of(var_string)
As I was building an example for gtsummary(), I was surprised that the all_of()
function worked here:
rlang::local_options(lifecycle_verbosity = "warning")
var_string = 'Species'
iris |>
gtsummary::tbl_summary(by=var_string)
iris |>
gtsummary::tbl_summary(by=all_of(var_string) )
I'm shocked that this works, because all_of()
normally only works inside tidyselect functions, but I guess it gets passed through to where it actually gets evaluated, which is inside a tidyselect situation. So this actually isn't a problem because I can solve the issue with an all_of()
in my code even though it gets evaluated much deeper in the code stack.
Awesome. I'm sorry to have drug you through this issue when I should have tried that.
If the user inputs a character string variable instead the quoted or unquoted string, a deprecation warning is thrown.
When running this code, the following is produced:
Currently this affects Daniel Sjoberg's
gtsummary
package, which calls this function. This is only an issue for me when testing my package which utilizes gtsummary and this warning shows up many times during the testthat execution. I'm working on a simple example for submitting an issue to gtsummary as well, but likely he'll end up here