Skip to contents

Native: rowwise() of a tbl_gpu only records which columns identify a row (metadata, no GPU work and no download; a lazy table keeps its pending operations). The result is a rowwise tbl_gpu: collect() returns dplyr's rowwise_df, as_tibble() and ungroup() drop the rowwise-ness, group_by() replaces it, and tbl_gpu() of a rowwise_df uploads one.

Usage

# S3 method for class 'tbl_gpu'
rowwise(data, ...)

Arguments

data

A tbl_gpu.

...

<tidy-select> Columns to keep as identifying variables in summarise(). A grouped table takes its group variables (naming others is an error, as in dplyr).

Value

A rowwise tbl_gpu.

Details

Elementwise expressions in mutate()/filter()/summarise() on a rowwise table run on the GPU as they would on a plain one (every column is one value per row). The horizontal aggregates sum()/mean()/min()/max()/prod() of c_across(<tidyselect>), of c(a, b, ...) or of several column arguments, n(), cur_group_id() and length(c_across(...)) are rewritten into GPU operations over the columns of each row, with dplyr's NA rules and result types (integer inputs give an integer sum()/min()/max(), a double sum if the integer range is left; an all-NA row of min()/max(na.rm = TRUE) is Inf/-Inf with dplyr's warning; on a lazy table a call with such an integer sum() runs at the verb, since its type depends on the data). Only logical, integer and double columns take part. Everything else (a function that needs the row as a vector, list-columns, window functions, .by) runs the whole call in dplyr on the CPU and comes back as a rowwise tbl_gpu.