Skip to content

Lookup ambiguity in data-expressions #76

Closed
@ghost

Description

@JohnMount commented on Sep 23, 2018, 2:35 PM UTC:

dplyr::select() returns a wrong column, should probably throw a "no such column/value" style exception.

library("dplyr")
packageVersion("dplyr")

    ## [1] '0.7.6'

packageVersion("rlang")

    ## [1] '0.2.2'

packageVersion("tidyselect")

    ## [1] '0.2.4'

y <- "x"

dxy <- data.frame(x = 1, y = 2)
dx <- data.frame(x = 1) 

# returns column x (correct)
dx %>%
 select(y)

    ##   x
    ## 1 1

# returns column y (incorrect)
dxy %>%
 select(y)

    ##   y
    ## 1 2

This issue was moved by romainfrancois from tidyverse/dplyr#3851.

Metadata

Metadata

Assignees

No one assigned

    Labels

    dslfeaturea feature request or enhancement

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions