You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If x is not a column name in data frame d, then pull(d, x) attempts to look up the value of x in the environment instead of returning NULL or an error as I would expect.
library(dplyr)
# Create two env-variablesd<-data.frame(x="ex", y="why")
x<-"y"# As expected, pulls the data-variable `x`
pull(d, x)
# If name `x` does not exist in `d`,d<- select(d, -x)
# Not expected: finds the env-variable `x`, pulls the data-variable `y`
pull(d, x)
# Exactly as if we had written pull(d, y)
identical(pull(d, x), pull(d, y))
The text was updated successfully, but these errors were encountered:
If
x
is not a column name in data framed
, thenpull(d, x)
attempts to look up the value ofx
in the environment instead of returning NULL or an error as I would expect.The text was updated successfully, but these errors were encountered: