take {SparkR}R Documentation

Take elements from an RDD.

Description

This function takes the first NUM elements in the RDD and returns them in a list.

Usage

take(rdd, num)

## S4 method for signature 'RDD,numeric'
take(rdd, num)

Arguments

rdd

The RDD to take elements from

num

Number of elements to take

Examples

## Not run: 
##D sc <- sparkR.init()
##D rdd <- parallelize(sc, 1:10)
##D take(rdd, 2L) # list(1, 2)
## End(Not run)

[Package SparkR version 0.1 Index]