Reputation: 143
this is my code
centros <- eventos %>%
filter(type_id==1 & 2:1 & Name == 'jack')
data sample
type_id Name 2
1 jack 1
2 Mary NA
4 Peter 1
Thanks in advance
Upvotes: 2
Views: 38
Reputation: 887223
We can use backquotes
library(dplyr)
centros <- eventos %>%
filter(type_id==1, `2` == 1, Name == 'jack')
centros
# type_id Name 2
#1 1 jack 1
eventos <- structure(list(type_id = c(1L, 2L, 4L), Name = c("jack", "Mary",
"Peter"), `2` = c(1L, NA, 1L)), class = "data.frame", row.names = c(NA,
-3L))
Upvotes: 2