takeOrdered {SparkR}R Documentation

Returns the first N elements from an RDD in ascending order.

Description

Returns the first N elements from an RDD in ascending order.

Usage

takeOrdered(rdd, num)

## S4 method for signature 'RDD,integer'
takeOrdered(rdd, num)

Arguments

rdd

An RDD.

num

Number of elements to return.

Value

The first N elements from the RDD in ascending order.

Examples

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

[Package SparkR version 0.1 Index]