Hi Christofer, Check ?tapply, ?aggregate and ?ave. Here is a way of doing in using the first function:
tapply(Dat1[, 3], list(Dat1[,1], Dat1[,2]), sum, na.rm = TRUE) HTH, Jorge.- On Wed, Dec 19, 2012 at 1:36 AM, Christofer Bogaso <> wrote: > Dat1 <- structure(list(factor.sample.LETTERS.1.3...6..replace...T.. = > structure(c(1L, > 3L, 2L, 1L, 3L, 3L), .Label = c("A", "B", "C"), class = "factor"), > factor.sample.letters.1.2...6..replace...T.. = structure(c(2L, > 2L, 1L, 1L, 2L, 1L), .Label = c("a", "b"), class = "factor"), > X1.6 = 1:6), .Names = c("factor.sample.LETTERS.1.3...6..replace...T..", > "factor.sample.letters.1.2...6..replace...T..", "X1.6"), row.names = c(NA, > -6L), class = "data.frame") > [[alternative HTML version deleted]] ______________________________________________ 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.