Strange behaviour of dplyr filter() function


When I write this down:

dane %>% dplyr::filter('27' >= 5.2) %>%  dplyr::filter('22' >= 0.45)

I got this:

So no results, but when I write that down:

dane %>% dplyr::filter(.$'27' >= 5.2) %>%  dplyr::filter(.$'22' >= 0.45)

I got this:

looks correct. Why is that ? My friend checked that and first command gives him correct results as well.

What could be the reason of it ?

A number is considered a non syntactic variable name, so it should be referenced between backticks, try with this

dane %>% dplyr::filter(`27` >= 5.2)

If this doesn't solve your problem please provide a proper reprex

Thank you,
I confused backtics with a single quotes, of course now it's working.
Thank you again very much.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.