one: Get one value from each group

View source: R/dplyr-funcs-agg.R

oneR Documentation

Get one value from each group

Description

Returns one arbitrary value from the input for each group. The function is biased towards non-null values: if there is at least one non-null value for a certain group, that value is returned, and only if all the values are null for the group will the function return null.

Usage

one(...)

Arguments

...

Unquoted column name to pull values from.

Examples

## Not run: 
mtcars |>
  arrow_table() |>
  group_by(cyl) |>
  summarize(x = one(disp))

## End(Not run)

arrow documentation built on April 11, 2025, 6:15 p.m.