dplyr filter issue with %in%

I have a list of records and trying to keep the four records out of my final result. I have created a filtered variable below and used the following code to get the results. The code runs but instead of filtering out 4 records it only filters two records and the last two records in the filter variable remain in the final result. what could I be doing wrong? filtered <- c( "Foundation1 - X", "Foundation2 - XX", "Y19 Success - XXX", "Fundan Prof - XXX")

live_adjusted <- live %>% dplyr::filter(!name%in%filtered)



Read more here: https://stackoverflow.com/questions/65701853/dplyr-filter-issue-with-in

Content Attribution

This content was originally published by onkaronkar4 at Recent Questions - Stack Overflow, and is syndicated here via their RSS feed. You can read the original post over there.

%d bloggers like this: