[R] need descriptive help

mkm1616 mkm1616 at gmail.com
Tue Jun 5 17:34:33 CEST 2012


Hi all, I'm new to using R, and apologize for simplicity of this
question.

I'm using a data set with over 60,000 observations, Two variables are
patient ID, and cost incurred by the patient.  I'd like to generate
frequency/table by patient and cost IF the total cost is over 2000.

Right now I'm using:

by(x$cost, x$patient, sum)

but this generates a huge list for each patient.

What is the best way to either (1) export the output into a csv so I
can visually inspect each patient or more helpful (2) create the table
IF sum of cost > 1000

Thanks!



More information about the R-help mailing list