rowwise: Group input by rows

Description Usage Arguments Details Examples

Description

rowwise() is used for the results of do() when you create list-variables. It is also useful to support arbitrary complex operations that need to be applied to each row.

Usage

1

Arguments

data

Input data frame.

Details

Currently, rowwise grouping only works with data frames. Its main impact is to allow you to work with list-variables in summarise() and mutate() without having to use [[1]]. This makes summarise() on a rowwise tbl effectively equivalent to [plyr::ldply()].

[[1]: R:[1 [plyr::ldply()]: R:plyr::ldply()

Examples

1
2
3
df <- expand.grid(x = 1:3, y = 3:1)
df %>% rowwise() %>% do(i = seq(.$x, .$y))
.Last.value %>% summarise(n = length(i))

YTLogos/dplyr documentation built on May 20, 2019, 1:44 p.m.