| rp_calculate | R Documentation |
Applies a list of summary functions to a list of columns, after optionally grouping the data.
rp_calculate(
.data,
...,
the.functions,
.by = NULL,
table_name = NULL,
return.as = "result"
)
.data |
An R data.frame. |
... |
Bare column names to summarize (e.g., |
the.functions |
A character vector of R function names
(e.g., |
.by |
A bare column name or |
table_name |
An optional character string. If provided, the generated Python code will replace the internal dataframe name with this string (e.g., |
return.as |
What to return: "result", "code", or "all". |
A data.frame with the summarized and grouped data.
if (reticulate::py_available(initialize = TRUE) &&
reticulate::py_module_available("pandas")) {
rp_calculate(
ggplot2::diamonds,
price, carat,
the.functions = c("mean", "sd"),
.by = cut
)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.