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

\item{k}{An integer specifying the number of rows to return. If \code{.by} is used,
returns up to k rows per group.}

\item{.by}{Optional grouping variables. Can be one or more unquoted column names.
When provided, the operation is performed on each group separately.}

\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{
Depending on \code{return.as}: a data frame, a character string, or a list.
}
\description{
This function returns the first k rows of the data frame. If grouping variables
are provided via \code{.by}, it returns the first k rows within each group.
}
