How to subset a dataframe using multiple conditions?
This does exactly the opposite, and I need to include "!"
x<-c("A", "B", "C", "D", "E")
df <- subset(df, subset = col_name %in% x)
How to subset a dataframe using multiple conditions?
This does exactly the opposite, and I need to include "!"
x<-c("A", "B", "C", "D", "E")
df <- subset(df, subset = col_name %in% x)
You can use filter function from dplyr package. The usual syntax is,
dplyr::filter(data, col1 cond, col2 cond, col3 cond....coln cond)
Links to other resources,
This allows you to create conditions however you want.