keyBy {SparkR}R Documentation

Creates tuples of the elements in this RDD by applying a function.

Description

Creates tuples of the elements in this RDD by applying a function.

Usage

keyBy(rdd, func)

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

Arguments

rdd

The RDD.

func

The function to be applied.

Examples

## 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)

[Package SparkR version 0.1 Index]