Re: [R] How to identify outliers with values five times 99th percentile

2014-09-09 Thread Rui Barradas
Hello, Try the following. out <- lapply(df, function(x){ qq <- quantile(x, probs = 0.99) which(x > 5*qq) }) out The list 'out' contains indices to the outliers. You can now have those outliers as follows df[out[[1]], 1] # first column Etc. Hope this helps, Rui Barradas

[R] How to identify outliers with values five times 99th percentile

2014-09-09 Thread Kuma Raj
I have a data frame with some extreme values which I wish to identify and repeat an analysis without these extreme values. How could I identify several columns with values which are 5 times higher than the 99th percentile? Sample data is pasted below. > dput(df) structure(list(ad1 = c(98, 6.9, 8