combDdo: "DDO" Recombination

Description Usage Arguments Details Author(s) See Also Examples

Description

"DDO" recombination - simply collect the results into a "ddo" object

Usage

1

Arguments

...

additional attributes to define the combiner (currently only used internally)

Details

combDdo is passed to the argument combine in recombine

Author(s)

Ryan Hafen

See Also

divide, recombine, combCollect, combMeanCoef, combRbind, combMean

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
# Divide the iris data
bySpecies <- divide(iris, by = "Species")

# Add a transform that returns a list for each subset
listTrans <- function(x) {
  list(meanPetalWidth = mean(x$Petal.Width),
       maxPetalLength = max(x$Petal.Length))
}

# Apply the transform and combine using combDdo
combined <- recombine(addTransform(bySpecies, listTrans), combine = combDdo)
combined
combined[[1]]

# A more concise (and readable) way to do it
bySpecies %>%
  addTransform(listTrans) %>%
  recombine(combDdo)

datadr documentation built on May 1, 2019, 8:06 p.m.