-1

I'm trying to create a separate df in R by filtering out observations based on specific criteria, but when using filter function from diplyr I only manage to create a df based on that criteria.

Can any body guide me on the right direction

test <- df_settlement %>% filter( Country Code== 'BE' &Order Date >= '2022-03-18' )

learnct
  • 13
  • 2
  • Have found how to make it work df_settlement <- df_settlement %>% filter( `Order Date` < B2B_StartDate | `Country Code` != 'BE' ) – learnct Mar 23 '22 at 15:04

1 Answers1

0

You have it almost right, you just want a comma after 'BE' instead of an &. It should look like this:

test <- df_settlement %>%
     filter(Country Code== 'BE',
            Order Date >= '2022-03-18')