% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/verbs_filter.R
\name{rp_calculate}
\alias{rp_calculate}
\title{Apply multiple summary functions to multiple columns}
\usage{
rp_calculate(
  .data,
  ...,
  the.functions,
  .by = NULL,
  table_name = NULL,
  return.as = "result"
)
}
\arguments{
\item{.data}{An R data.frame.}

\item{...}{Bare column names to summarize (e.g., \verb{price, carat}).}

\item{the.functions}{A character vector of R function names
(e.g., \code{c("mean", "sd")}). Supports "mean", "median", "sd",
"var", "min", "max", "sum".}

\item{.by}{A bare column name or \code{c(col1, col2)} to group by.}

\item{table_name}{An optional character string. If provided, the generated Python code will replace the internal dataframe name with this string (e.g., \code{"diamonds.query(...)"}). This is useful for seeing the exact, copy-pasteable Python code. Defaults to \code{NULL} (uses \code{"df"}).}

\item{return.as}{What to return: "result", "code", or "all".}
}
\value{
A \code{data.frame} with the summarized and grouped data.
}
\description{
Applies a list of summary functions to a list of columns, after
optionally grouping the data.
}
\examples{
\donttest{
if (reticulate::py_available(initialize = TRUE) &&
    reticulate::py_module_available("pandas")) {

  rp_calculate(
    ggplot2::diamonds,
    price, carat,
    the.functions = c("mean", "sd"),
    .by = cut
  )
}
}
}
