I have this data frame:
df <- data.frame (ID = c(1:20),
Ethnicity = c(rep(c("White", "Asian", "Black", "Hispanic", "Other"), times=20/5)),
Age = c(1:20),
Set = rep(c(1,2,3,4), times=20/4)
)
Is there a way to filter out all the rows where Ethnicity
is NOT Asian using the filter
function in R? Maybe something similar to -filter
?
Thanks!