[R] table function

Erik Iverson eiverson at NMDP.ORG
Mon Aug 24 18:31:15 CEST 2009


You need to create a factor that indicates which group the values in 'z' belong to.  The easiest way to do that based on your situation is to use the 'cut' function to construct the factor, and then call 'table' using the result created by 'cut'.  See ?cut and ?factor 

-----Original Message-----
From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-project.org] On Behalf Of Inchallah Yarab
Sent: Monday, August 24, 2009 10:59 AM
To: r-help at r-project.org
Subject: [R] table function

hi,

i want to use the function table to build a table not of frequence (number of time the vareable is repeated in a list or a data frame!!) but in function of classes
I don t find a clear explnation in  examples of  ?table !!!

example

x      y        z
1    0       100
5    1       1500
6    1       1200 
2    2       500 
1    1       3500 
5     2     2000 
8     5     4500

i want to do a table summerizing the number of variable where z is in [0-1000],],[1000-3000], [> 3000]

thank you very much for your help


      
	[[alternative HTML version deleted]]




More information about the R-help mailing list