[R] aggregate similar to SPSS

Andrew Robinson A.Robinson at ms.unimelb.edu.au
Thu Apr 26 00:56:09 CEST 2007


Hi Nat,

can I suggest, without offending, that you purchase and read Peter
Dalgaard's "Introductory Statistics with R" or Michael Crawley's
"Statistics: An Introduction using R" or Venables and Ripley's "Modern
Applied Statistics with S" or Maindonald and Braun's "Data Analysis
and Graphics Using R: An Example-based Approach",

or

download and read An Introduction to R 

http://cran.r-project.org/doc/manuals/R-intro.pdf

or one of the numerous contributed documents at

http://cran.r-project.org/other-docs.html

?

I hope that this helps,

Andrew.

On Wed, Apr 25, 2007 at 03:32:11PM -0600, Natalie O'Toole wrote:
> Hi,
> 
> Does anyone know if: with R can you take a set of numbers and aggregate
> them like you can in SPSS? For example, could you calculate the percentage
> of people who smoke based on a dataset like the following:
> 
> smoke = 1
> non-smoke = 2
> 
> variable
> 1
> 1
> 1
> 2
> 2
> 1
> 1
> 1
> 2
> 2
> 2
> 2
> 2
> 2
> 
> 
> When aggregated, SPSS can tell you what percentage of persons are smokers
> based on the frequency of 1's and 2's. Can R statistical package do a
> similar thing?
> 
> Thanks,
> 
> Nat
> 
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.

-- 
Andrew Robinson  
Department of Mathematics and Statistics            Tel: +61-3-8344-9763
University of Melbourne, VIC 3010 Australia         Fax: +61-3-8344-4599
http://www.ms.unimelb.edu.au/~andrewpr
http://blogs.mbs.edu/fishing-in-the-bay/



More information about the R-help mailing list