[R] Ordering data by variable

Joshua Wiley jwiley.psych at gmail.com
Fri Sep 3 11:13:49 CEST 2010


On Thu, Sep 2, 2010 at 2:33 PM, Greg Snow <Greg.Snow at imail.org> wrote:
> Suggestion:  use the power of R.
>
> If x and y are independent then sorting y based on x is meaningless.
>
> If sorting y based on x is meaningful, then they are not independent.
>
> Trying to force non-independent things to pretend that they are independent just causes future headaches.
>
> Part of the great power of R is the ability to group things together that should be grouped.  The wise learn this and use it (in some cases (mine) that wisdom comes at the expense of not having properly grouped in the past).

Yes, this is an excellent suggestion.  My workspace used to be like a
rock pile that my poor brain had to dig through, trying to remember
some truly awful combinations of capitalizations, '.' , '_' , and
numerals from my vain efforts to organize variables.  Dataframes (and
lists for those pesky variables with irregular lengths) were the rake
that brought peace and tranquility to the rock garden of my workspace.

Josh

> Learn the power of with/within, data= arguments, and apply style functions, then you will be eager to combine things into data frames (or lists or ...) when appropriate.
>
> <<descend from soapbox>>
>
> --
> Gregory (Greg) L. Snow Ph.D.
> Statistical Data Center
> Intermountain Healthcare
> greg.snow at imail.org
> 801.408.8111



More information about the R-help mailing list