reduce {SparkR}R Documentation

Reduce across elements of an RDD.

Description

This function reduces the elements of this RDD using the specified commutative and associative binary operator.

Usage

reduce(rdd, func)

## S4 method for signature 'RDD'
reduce(rdd, func)

Arguments

rdd

The RDD to reduce

func

Commutative and associative function to apply on elements of the RDD.

Examples

## Not run: 
##D sc <- sparkR.init()
##D rdd <- parallelize(sc, 1:10)
##D reduce(rdd, "+") # 55
## End(Not run)

[Package SparkR version 0.1 Index]