-5

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)
user2904120
  • 416
  • 1
  • 4
  • 18

1 Answers1

0

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.

Resh
  • 143
  • 1
  • 9