countByKey {SparkR} | R Documentation |
Same as countByKey in Spark.
countByKey(rdd) ## S4 method for signature 'RDD' countByKey(rdd)
rdd |
The RDD to count keys. |
list of (key, count) pairs, where count is number of each key in rdd.
## Not run:
##D sc <- sparkR.init()
##D rdd <- parallelize(sc, list(c("a", 1), c("b", 1), c("a", 1)))
##D countByKey(rdd) # ("a", 2L), ("b", 1L)
## End(Not run)