filterRDD {SparkR} | R Documentation |
This function returns a new RDD containing only the elements that satisfy a predicate (i.e. returning TRUE in a given logical function). The same as ‘filter()’ in Spark.
filterRDD(x, f) ## S4 method for signature 'RDD,'function'' filterRDD(x, f) ## S4 method for signature ''function',RDD' Filter(f, x)
x |
The RDD to be filtered. |
f |
A unary predicate function. |
## Not run:
##D sc <- sparkR.init()
##D rdd <- parallelize(sc, 1:10)
##D unlist(collect(filterRDD(rdd, function (x) { x < 3 }))) # c(1, 2)
## End(Not run)