Guru's Verification engine ensures consistency, confidence, and trust in the knowledge your organization shares. Learn more.

R | dplyr Variable Column Names (Indirection)

The dplyr grammar has a handy data masking feature, which means that within dplyr verbs, column variables in tables can be referenced like regular variables (e.g. you can do select(tbl, some_column) instead of select(tbl, "some_column").

This is convenient for performing exploratory analysis with hardcoded column names, but is problematic when the code needs the column name to be a variable. The dplyr documentation refers to this as "indirection".

See below for resources for dealing with this issue:

You must have Author or Collection Owner permission to create Guru Cards. Contact your team's Guru admins to use this template.