I want to remove from my dataframe all the observations where at least one variable is beyond 2 standard deviations. I've got 38 variables plus two others columns.
These lines extract the outliers:
std=2
outliers = boxplot(data[3:40], plot=FALSE,range=std)$out
but I can't update my dataframe, I tried a bunch of things like:
data[3:40][!data[3:40] %in% outliers]
Can you help me please?