dplyr: Run grouped 'do' in parallel.

Description Usage Arguments Examples

Description

Injects execution of do and if .data is groupped, executes the operation in parallel.

Usage

1
2
3
parallelize(.data)

do_.parallel(.data, ..., env = parent.frame(), .dots = list())

Arguments

.data

data object transformed with [parallelize]

...

expressions to apply to each group; see [dplyr::do]

env

the environment in which functions should be evaluated; see [dplyr::do]

.dots

pair/values of expressions coercible to lazy objects; see [dplyr::do]

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
## Not run: 
iris %>%
  group_by(Species) %>%
  parallelize %>%
  do({
    # something that's better run in paralle
    data.frame(result = 1)
  })

## End(Not run)

lbartnik/defer documentation built on May 20, 2019, 8:27 p.m.