% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/verbs_filter.R
\name{rp_count}
\alias{rp_count}
\title{Count rows in a data frame, optionally by groups}
\usage{
rp_count(.data, .by = NULL, table_name = NULL, return.as = "result")
}
\arguments{
\item{.data}{An R data frame (or tibble) to be processed.}

\item{.by}{Optional grouping variables. Can be one or more unquoted column names
(e.g., \code{cut} or \code{c(cut, color)}). When provided, counts are computed per group.}

\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}{One of \code{"result"}, \code{"code"}, or \code{"all"}.}
}
\value{
A data frame with one column \code{"n"} (total row count) if \code{.by = NULL},
or a data frame with the grouping columns and a column \code{"n"} (per‑group counts).
}
\description{
This function returns the number of rows in a data frame. When grouping
variables are provided via \code{.by}, it returns the row counts for each group.
}
