I want to detect outliers per group and display it in a separate dataframe, for example, for each species name, anthopleura aureradiata, I want to look at values 27.75, 6.83, and 23.91, and calculate the outliers between these values. If I find that row 4 is an outlier for that particular species, I want to display it in my new dataframe. Does anyone know how to get about this?
Reproducible example:
x = data.frame("species" = c("Agao", "Beta", "Beta", "Beta", "Carrot", "Carrot"), "sum" = c(1, 100, 5, 4, 3, 0))