takeOrdered {SparkR} | R Documentation |
Returns the first N elements from an RDD in ascending order.
takeOrdered(rdd, num) ## S4 method for signature 'RDD,integer' takeOrdered(rdd, num)
rdd |
An RDD. |
num |
Number of elements to return. |
The first N elements from the RDD in ascending order.
## Not run:
##D sc <- sparkR.init()
##D rdd <- parallelize(sc, list(10, 1, 2, 9, 3, 4, 5, 6, 7))
##D takeOrdered(rdd, 6L) # list(1, 2, 3, 4, 5, 6)
## End(Not run)