Videos
You have the anova object inside a list (first line of str output is List of 1). So you need to get the "F value" of this single element, like:
summm[[1]][["F value"]]
As an addition to the answer above I'd recommend to start using the broom package when you want to access/use various elements of a model object.
First, by using the str command you don't convert the summary into a string, but you just see the structure of your summary, which is a list. So, str means "structure".
The broom package enables you to save the info of your model object as a data frame, which is easier to manipulate. Check my simple example:
library(broom)
fit <- aov(mpg ~ vs, data = mtcars)
# check the summary of the ANOVA (not possible to access info/elements)
fit2 = summary(fit)
fit2
# Df Sum Sq Mean Sq F value Pr(>F)
# vs 1 496.5 496.5 23.66 3.42e-05 ***
# Residuals 30 629.5 21.0
# create a data frame of the ANOVA
fit3 = tidy(fit)
fit3
# term df sumsq meansq statistic p.value
# 1 vs 1 496.5279 496.52790 23.66224 3.415937e-05
# 2 Residuals 30 629.5193 20.98398 NA NA
# get F value (or any other values)
fit3$statistic[1]
#[1] 23.66224
I think for the specific example you provided you don't really need to use the broom method, but if it happens to deal with more complicated model objects it will be really useful to try it.
1. tapply
I'll put in my two cents for tapply().
tapply(df$dt, df$group, summary)
You could write a custom function with the specific statistics you want or format the results:
tapply(df$dt, df$group,
function(x) format(summary(x), scientific = TRUE))
$A
Min. 1st Qu. Median Mean 3rd Qu. Max.
"5.900e+01" "5.975e+01" "6.100e+01" "6.100e+01" "6.225e+01" "6.300e+01"
$B
Min. 1st Qu. Median Mean 3rd Qu. Max.
"6.300e+01" "6.425e+01" "6.550e+01" "6.600e+01" "6.675e+01" "7.100e+01"
$C
Min. 1st Qu. Median Mean 3rd Qu. Max.
"6.600e+01" "6.725e+01" "6.800e+01" "6.800e+01" "6.800e+01" "7.100e+01"
$D
Min. 1st Qu. Median Mean 3rd Qu. Max.
"5.600e+01" "5.975e+01" "6.150e+01" "6.100e+01" "6.300e+01" "6.400e+01"
2. data.table
The data.table package offers a lot of helpful and fast tools for these types of operation:
library(data.table)
setDT(df)
> df[, as.list(summary(dt)), by = group]
group Min. 1st Qu. Median Mean 3rd Qu. Max.
1: A 59 59.75 61.0 61 62.25 63
2: B 63 64.25 65.5 66 66.75 71
3: C 66 67.25 68.0 68 68.00 71
4: D 56 59.75 61.5 61 63.00 64
dplyr package could be nice alternative to this problem:
library(dplyr)
df %>%
group_by(group) %>%
summarize(mean = mean(dt),
sum = sum(dt))
To get 1st quadrant and 3rd quadrant
df %>%
group_by(group) %>%
summarize(q1 = quantile(dt, 0.25),
q3 = quantile(dt, 0.75))