View Full Version : R Question - Summary for a portion of the distribution
FiReSTaRT
May 4th, 2009, 01:32 PM
Googling and #R haven't been to helpful, so I'm hoping fellow-Ubuntu users will be able to help me out with this one.
The problem:
1) I have a dataset loaded into R
2) I want to calculate the summary stats for only the inner 90% (arbitrary figure) of the distribution of a variable, thus eliminating the outliers on each end.
Can anyone tell me how I would go about this?
P.S. I only need the mean, but I assume that it would still somehow go through the summary command.
FiReSTaRT
May 4th, 2009, 02:30 PM
Never mind.. The trim argument seems to do the trick, as in mean(layer@data$MCGE, trim = 0.05).
gunksta
May 5th, 2009, 12:26 AM
R is a great tool. But it can also be mind numbingly cryptic and Googling for R is often a complete and utter waste of time. That is why R-Seek is your friend.
http://www.rseek.org/
You can also join the R mailing list which is a great way to annoy Google and make them constantly expand their Gmail account space. It's a very busy list, don't even try to read it all. It is conveniently populated with some very very smart people. Warning: Read the posting directions before posting and I suggest growing a bit of a thick skin. Comments can be direct and more than a little blunt, but the info is worth it. I learn just by lurking.
ahmatti
May 5th, 2009, 12:54 AM
I learn just by lurking.
This is what I do too :) I use the nabble interface to follow the R-mailing list, that way my mailbox is a little bit less full: http://www.nabble.com/R-f13819.html
gunksta
May 5th, 2009, 09:47 AM
Oooh. I like that. Thanks.
FiReSTaRT
September 7th, 2009, 10:24 AM
Ahhh I didn't even know about rseek. Definitely bookmarked. Thanks for the link!
vBulletin® v3.8.4, Copyright ©2000-2012, Jelsoft Enterprises Ltd.