foreach {SparkR} | R Documentation |
Applies a function to all elements in an RDD, and force evaluation.
Applies a function to each partition in an RDD, and force evaluation.
foreach(rdd, func) ## S4 method for signature 'RDD,'function'' foreach(rdd, func) foreachPartition(rdd, func) ## S4 method for signature 'RDD,'function'' foreachPartition(rdd, func)
rdd |
The RDD to apply the function |
func |
The function to be applied. |
invisible NULL.
## Not run:
##D sc <- sparkR.init()
##D rdd <- parallelize(sc, 1:10)
##D foreach(rdd, function(x) { save(x, file=...) })
## End(Not run)
## Not run:
##D sc <- sparkR.init()
##D rdd <- parallelize(sc, 1:10)
##D foreachPartition(rdd, function(part) { save(part, file=...); NULL })
## End(Not run)