con <- DBI::dbConnect(RSQLite::SQLite(), ":memory:") DBI::dbWriteTable(con, "iris", iris) iris2 <- tbl(con, "iris") species_mean <- iris2 %>% group_by(Species) %>% summarise_all(mean)