Re: [R] RE:

About this list Date view Thread view Subject view Author view Attachment view

From: David Meyer (david.meyer@ci.tuwien.ac.at)
Date: Fri 25 Jan 2002 - 21:24:30 EST


Message-id: <3C51325E.527C05CA@ci.tuwien.ac.at>

Carlos Ortega wrote:
>
> Hello,
>
> Although your message is not very explicit about the structure of your data
> frame,
> I think you can get what you want by using a combination of the function
> "split" and
> the "apply" functions family: apply, lapply and sapply.
>
> If you provide a more detailed organization of your data frame, perhaps we
> can give
> to you a more wiser advice.

aggregate() is your friend.

-d

>
> Thanks,
> Carlos.
> P.S: By the way, please include in the "Subject" a more descriptive message.
>
> -----Mensaje original-----
> De: owner-r-help@stat.math.ethz.ch
> [mailto:owner-r-help@stat.math.ethz.ch]En nombre de Erin Hodgess
> Enviado el: miércoles, 23 de enero de 2002 22:39
> Para: r-help@stat.math.ethz.ch
> Asunto:
>
> Dear R People:
>
> Here is a very simple question, please:
>
> I have a data frame with the state name, state division, and population.
>
> Note: state division is something like Atlantic, Mountain, etc.
>
> I want to produce a table with the state division and the total of the
> populations for the states within that division.
>
> I've been messing with "table" but so far, no luck.
>
> This is R1.3.1, on Windows 98.
>
> thanks in advance!
>
> Sincerely,
> Erin Hodgess
> Associate Professor
> Department of Computer and Mathematical Sciences
> University of Houston - Downtown
> 1 Main Street
> Houston, TX 77002
> mailto: hodgess@uhddx01.dt.uh.edu
> -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
> r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
> Send "info", "help", or "[un]subscribe"
> (in the "body", not the subject !) To: r-help-request@stat.math.ethz.ch
> _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._

-- 
	Mag. David Meyer		Wiedner Hauptstrasse 8-10
Vienna University of Technology		A-1040 Vienna/AUSTRIA
       Department for			Tel.: (+431) 58801/10772
Statistics and Probability Theory	mail: david.meyer@ci.tuwien.ac.at
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request@stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._


About this list Date view Thread view Subject view Author view Attachment view

This archive was generated by hypermail 2.1.3 : Wed 16 Oct 2002 - 11:56:55 EST