5
Consider the following data.frame and the variable x
df <- data.frame(x = c(rep(0, 10), rep(1, 10)), y = 1:20)
x <- 0
I tried to use the dplyr to select column elements x equal to the global variable x
library(dplyr)
df %>% filter(x == x))
But I got all the data.frame in the answer. The filter should be considering only the column, I imagine.
As I point out to the filter that one of x is a global variable?