keyBy {SparkR} | R Documentation |
Creates tuples of the elements in this RDD by applying a function.
keyBy(rdd, func) ## S4 method for signature 'RDD,'function'' keyBy(rdd, func)
rdd |
The RDD. |
func |
The function to be applied. |
## Not run:
##D sc <- sparkR.init()
##D rdd <- parallelize(sc, list(1, 2, 3))
##D collect(keyBy(rdd, function(x) { x*x })) # list(list(1, 1), list(4, 2), list(9, 3))
## End(Not run)