Inchallah Yarab wrote: > > i want to do a table summerizing the number of variable where z is in > [0-1000],],[1000-3000], [> 3000] >
You can use "cut" to create a new vector of labels and tabulate the result. Options control closed/open endpoints (see ?cut): > z <- c(100,1500,1200,500,3500,2000,4500) > table(cut(z,c(0,1000,3000,max(z)))) (0,1e+03] (1e+03,3e+03] (3e+03,4.5e+03] 2 3 2 -- View this message in context: http://www.nabble.com/table-function-tp25118909p25119226.html Sent from the R help mailing list archive at Nabble.com. ______________________________________________ R-help@r-project.org 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.