View source: R/verb-summarise.R
summarise.tbl_lazy | R Documentation |
This is a method for the dplyr summarise()
generic. It generates the
SELECT
clause of the SQL query, and generally needs to be combined with
group_by()
.
## S3 method for class 'tbl_lazy'
summarise(.data, ..., .by = NULL, .groups = NULL)
.data |
A lazy data frame backed by a database query. |
... |
< |
.by |
< |
.groups |
\Sexpr[results=rd]{lifecycle::badge("experimental")} Grouping structure of the result.
When In addition, a message informs you of that choice, unless the result is ungrouped,
the option "dplyr.summarise.inform" is set to |
Another tbl_lazy
. Use show_query()
to see the generated
query, and use collect()
to execute the query
and return data to R.
library(dplyr, warn.conflicts = FALSE)
db <- memdb_frame(g = c(1, 1, 1, 2, 2), x = c(4, 3, 6, 9, 2))
db %>%
summarise(n()) %>%
show_query()
db %>%
group_by(g) %>%
summarise(n()) %>%
show_query()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.