Try this: i[quantile(i,.25)< i & i < quantile(i,.75)]
Andrija On Thu, Feb 17, 2011 at 11:08 AM, Maas James Dr (MED) <j.m...@uea.ac.uk>wrote: > I'm trying to work out the simplest way to remove the upper and lower > quantiles, in this case upper and lower 25% from an array. I can do it in > two steps but when I try it in one, it fails. Is there something simple > missing from my syntax or are there other simple elegant way to accomplish > this? > > Thanks > > J > > > i <-1:20 > > i2 <- i[i<quantile(i,.75)] > > i3 <- i[i>quantile(i,.25)] > > i4 <- i[quantile(i,.25)< i > quantile(i,.75)] > Error: unexpected '>' in "i4 <- i[quantile(i,.25)< i >" > > =============================== > Dr. Jim Maas > University of East Anglia > > ______________________________________________ > R-help@r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide > http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. > [[alternative HTML version deleted]] ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.