rp_select: Filtering columns

View source: R/verbs_filter.R

rp_selectR Documentation

Filtering columns

Description

Selects specific columns from a data frame. It captures the bare column names and translates the operation into a pandas selection command.

Usage

rp_select(.data, ..., table_name = NULL, return.as = "result")

Arguments

.data

An R data.frame or tibble.

...

The bare column names to select (e.g., ⁠carat, cut, price⁠).

table_name

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

return.as

What to return: "result", "code", or "all".

Value

A data.frame containing only the selected columns.

Examples


if (reticulate::py_available(initialize = TRUE) &&
    reticulate::py_module_available("pandas")) {
  rp_select(ggplot2::diamonds, carat, cut, price)
}


rPandas documentation built on April 29, 2026, 1:07 a.m.