take {SparkR} | R Documentation |
This function takes the first NUM elements in the RDD and returns them in a list.
take(rdd, num) ## S4 method for signature 'RDD,numeric' take(rdd, num)
rdd |
The RDD to take elements from |
num |
Number of elements to take |
## Not run:
##D sc <- sparkR.init()
##D rdd <- parallelize(sc, 1:10)
##D take(rdd, 2L) # list(1, 2)
## End(Not run)