countByValue {SparkR}R Documentation

Return the count of each unique value in this RDD as a list of (value, count) pairs.

Description

Same as countByValue in Spark.

Usage

countByValue(rdd)

## S4 method for signature 'RDD'
countByValue(rdd)

Arguments

rdd

The RDD to count

Value

list of (value, count) pairs, where count is number of each unique value in rdd.

Examples

## Not run: 
##D sc <- sparkR.init()
##D rdd <- parallelize(sc, c(1,2,3,2,1))
##D countByValue(rdd) # (1,2L), (2,2L), (3,1L)
## End(Not run)

[Package SparkR version 0.1 Index]