10 24 43
6B H 13 17 28
-
David L Carlson
Department of Anthropology
Texas A&M University
College Station, TX 77840-4352
-Original Message-
From: R-help [mailto:r-help-boun...@r-project.org] On Behalf O
Good day,
Yes, exactly. I found that aggregate is another alternative which doesn't
require a package dependency, although the column formatting is less suitable,
always prepending x.
aggregate(warpbreaks[, 1], warpbreaks[, 2:3], function(breaks) c(Min =
min(breaks), Med = median(breaks), Max
Do you want something like the following?
> library(dplyr, quietly=TRUE, warn.conflicts=FALSE)
> warpbreaks %>% group_by(wool, tension) %>% summarize(Min=min(breaks),
> Median=median(breaks), Max=max(breaks))
Source: local data frame [6 x 5]
Groups: wool
wool tension Min Median Max
1A
Good day,
How is it possible to get a data.frame of factor levels used for obtaining each
element of the result of the by function ? For example,
result <- by(warpbreaks[, 1], warpbreaks[, -1], summary)
> result
wool: A
tension: L
Min. 1st Qu. MedianMean 3rd Qu.Max.
25.00 26.0
4 matches
Mail list logo