datadr (version 0.8.4)

combRbind: "rbind" Recombination

Description

"rbind" recombination - Combine ddf divisions by row binding

Usage

combRbind(...)

Arguments

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

Details

combRbind is passed to the argument combine in recombine

See Also

divide, recombine, combDdo, combDdf, combCollect, combMeanCoef, combMean

Examples

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

# Create a function that will calculate the standard deviation of each
# variable in in a subset. The calls to 'as.data.frame()' and 't()'
# convert the vector output of 'apply()' into a data.frame with a single row
sdCol <- function(x) as.data.frame(t(apply(x, 2, sd)))

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

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

Run the code above in your browser using DataLab