Learn R Programming

datadr (version 0.8.6.1)

combCollect: "Collect" Recombination

Description

"Collect" recombination - collect the results into a local list of key-value pairs

Usage

combCollect(...)

Arguments

Additional list elements that will be added to the returned object

Details

combCollect is passed to the argument combine in recombine

See Also

divide, recombine, combDdo, combDdf, combMeanCoef, combRbind, combMean

Examples

Run this code
# NOT RUN {
# Create a distributed data frame using the iris data set
bySpecies <- divide(iris, by = "Species")

# Function to calculate the mean of the petal widths
meanPetal <- function(x) mean(x$Petal.Width)

# Combine the results using rbind
combined <- recombine(addTransform(bySpecies, meanPetal), combine = combCollect)
class(combined)
combined

# A more concise (and readable) way to do it
bySpecies %>%
  addTransform(meanPetal) %>%
  recombine(combCollect)
# }

Run the code above in your browser using DataLab