[R] sequencial frequency table

From: Mauricio Cardeal <mcardeal_at_ufba.br>
Date: Tue 30 Jan 2007 - 13:03:43 GMT


Hi.

I have the data frame xyz below and Id like to perform a sequencial frequency table using some unique function instead of making 3 different one-by-one table (table x, table y and table z). But Icant figure out the correct way.

x <- c(2,3,2,4)
y <- c(3,1,1,1)
z <- c(4,2,1,4)

xyz <- as.data.frame(cbind(x,y,z))

freq <- function(x){
table(x)
}

freq(xyz)

Thank you,
Mauricio



R-help@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. Received on Wed Jan 31 00:08:27 2007

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Tue 30 Jan 2007 - 15:30:25 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.