[R] favorite useful tools?
Michael Dewey
info at aghmed.fsnet.co.uk
Sun Jun 8 12:27:39 CEST 2008
At 15:16 07/06/2008, Carl Witthoft wrote:
>Hi,
>I'm relatively new to R, so I don't know the full list of base (or
>popular add-on packages) functions and tools available. For
>example, I tripped across mention of rle() in a message about some
>other problem. rle() turned out to be a handy shortcut to splitting
>some of my data by magnitude (vaguely like a sequence-based histogram).
>So I thought I'd ask: what small, or obscure, tools and functions in
>R do you find handy or 'cool' to use in your work?
In a similar vein to your comment about rle (which I found in the
same way as you and for which I would never have thought of looking)
perhaps I could suggest str()? I picked this up by reading R-help.
When R's behaviour is unexpected (to you) using
str(your_dataframe)
often reveals why.
And for a bonus
1 - if the function has a data= parameter then always use it
2 - use with() rather than attaching and detaching things
These have saved me hours.
>Thanks
>Carl
>
>
Michael Dewey
http://www.aghmed.fsnet.co.uk
More information about the R-help
mailing list