Skip to content

A better data masking indirection example in the programming.Rmd vignette: filter(df, {{ var }}) #6978

@wbzyl

Description

@wbzyl

This code does not work:

f <- function(df, var) filter(df, {{ var }})
f(mtcars, am)
# Error in `filter()`:
# ℹ In argument: `vs`.
# Caused by error:
# ! `..1` must be a logical vector, not a double vector.

This code works:

f <- function(df, var) filter(df, {{ var }} == 0)
f(mtcars, vs)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions