On Thu, 8 Apr 2010, James Rome wrote:
I am trying to calculate quantiles of a data frame column split up by
two factors:
# Calculate the quantiles
quarts = tapply(gdf$tt, list(gdf$Runway, gdf$OnHour), FUN=quantile,
na.rm = TRUE)
This does not work:
It seems like it did work. It returned a
Hi James,
I don't know how to solve it with "tapply" (something with split I
think..), but you could use "plyr" (from Hadley Wickham).
library(plyr)
# Generate some data
set.seed(321)
myD <- data.frame(
Place = sample(c("AWQ","DFR", "WEQ"), 10, replace=T),
Light = sample(LETTERS[1:2], 15,
I am trying to calculate quantiles of a data frame column split up by
two factors:
# Calculate the quantiles
quarts = tapply(gdf$tt, list(gdf$Runway, gdf$OnHour), FUN=quantile,
na.rm = TRUE)
This does not work:
> quarts
04L 04R 15R 22L 22R 2732
33L
3 matches
Mail list logo