% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/verbs_filter.R
\name{rp_sort}
\alias{rp_sort}
\title{Sort rows of a data frame using pandas}
\usage{
rp_sort(.data, ..., table_name = NULL, return.as = "result")
}
\arguments{
\item{.data}{An R data.frame or tibble.}

\item{...}{Bare column names to sort by. Use \code{desc(colname)} to sort
in descending order (e.g., \verb{cut, desc(price)}).}

\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} sorted by the specified columns.
}
\description{
Sorts a data frame by one or more columns. It translates the R expressions
into a pandas \code{.sort_values()} command and executes it.
}
\examples{
\donttest{
if (reticulate::py_available(initialize = TRUE) &&
    reticulate::py_module_available("pandas")) {
  
  # Sort by cut (ascending) and price (descending)
  rp_sort(ggplot2::diamonds, cut, desc(price))
}
}
}
