0

In particular, when spreading a tibble, dplyr name the columns with ` ` (in case of strings or dates) and I noticed that it is not interchangeable with neither ' ' nor "".

After having spreaded a tibble I´ve ended up with names in the columns. And I was trying to filter with `` and it was not working.

pms$releases$date_201803$table_6443 %>% 
  filter( `Variável (Código)` == "8677", `Tipos de índice (Código)` %in% c("40311", "40312")) 

But the alternative bellow works fine, and I was trying to understand the relation between the types of quotation.

colunas <- c("Variável (Código)", "Tipos de índice (Código)")

pms$releases$date_201803$table_6443 %>% 
  filter(!!as.name(colunas[1]) == "8677", !!as.name(colunas[2]) %in% c("40311", "40312")) 
neilfws
  • 32,751
  • 5
  • 50
  • 63
motabe
  • 101
  • 1
  • 6

0 Answers0