2 ms·
R syntax is not too bad # group by Species, can be multivalued see ?by # sum(Sepal.Length, Sepal.Width) # mean(Petal.Length, Petal.Width) by(data = iri
by sapuser 16y ago
R syntax is not too bad
# group by Species, can be multivalued see ?by
# sum(Sepal.Length, Sepal.Width)
# mean(Petal.Length, Petal.Width)
by(data = iris, INDICES = iris$Species, FUN = function(x) {y <- colSums(x[,c(1:2)]); z <- mean(x[,c(3:4)]); result <- list(y,z); result})