I have a dataset with four variables (a,b,c,d). I want to group the data by a,b,c then find out outliers for d.
Here is the sample data: https://www.dropbox.com/s/ftp4eehqxzh7nn3/example.csv?dl=0
I tried:
outliers = data %>%
group_by(a,b,c) %>%
which (data$d > quantile (data$d, na.rm=T)[4] + 1.5*IQR(data$d, na.rm = T) | data$d < quantile (data$d, na.rm=T)[2] - 1.5*IQR(data$d, na.rm = T).
However, I got error argument to 'which' is not logical.
Would appreciate if anyone can tell me what I got wrong and how should I fix the problem.