Learn R Programming

datadr (version 0.8.6.1)

combDdo: "DDO" Recombination

Description

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

Usage

combDdo(...)

Arguments

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

Details

combDdo is passed to the argument combine in recombine

See Also

divide, recombine, combCollect, combMeanCoef, combRbind, combMean

Examples

Run this code
# NOT RUN {
# 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)
# }

Run the code above in your browser using DataLab