Closed smgogarten closed 1 month ago
dm_filter(my_dm, !!sym(my_table) = (!!sym(my_column) == my_value))
cannot work because it's not syntactic, no package can make this work, however this will work if you use :=
instead, this works similarly with tidyverse functions.
dm_filter(my_dm, !!sym(my_table) := (!!sym(my_column) == my_value))
Another solution
dm_filter(my_dm, "{my_table}" := (!!sym(my_column) == my_value))
That is very helpful, thank you! I didn't know about the :=
syntax.
I'd like to be able to embed
dm_filter
in a function that filters a table with an arbitrary table name, column and value. Unquoting the column name can be done with!!sym()
, but I've tried several ways of unquoting the table name and can't find any that work. Is this possible now, or can it be made possible in the future?