mutate_.list: Dplyr verbs for lists and pairlists

Description Usage Arguments Value See Also Examples

View source: R/verbs_for_lists.R

Description

We add methods for the verbs mutate, rename.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
## S3 method for class 'list'
mutate_(.data, ..., .dots)

## S3 method for class 'pairlist'
mutate_(.data, ..., .dots)

## S3 method for class 'list'
rename_(.data, ..., .dots)

## S3 method for class 'pairlist'
rename_(.data, ..., .dots)

Arguments

.data

A list or pairlist.

...

Comma separated list of unquoted expressions.

.dots

Used to work around non-standard evaluation.

Value

A list or a pairlist.

See Also

mutate, rename from package dplyr.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
xs <- list(x1 = 1:3, 
           x2 = 2:5, 
           x3 = list("alpha", c("beta", "gamma")))

# Non-standard evaluation
mutate(xs, x4 = 4)
rename(xs, x0 = x1)

# Standard evaluation
mutate_(xs, x4 = ~ 4)
rename_(xs, x0 = ~ x1)

lplyr documentation built on May 2, 2019, 11:58 a.m.