parallelize {SparkR} | R Documentation |
This function creates an RDD from a local homogeneous list in R. The elements
in the list are split into numSlices
slices and distributed to nodes
in the cluster.
parallelize(sc, coll, numSlices = 1)
sc |
SparkContext to use |
coll |
collection to parallelize |
numSlices |
number of partitions to create in the RDD |
an RDD created from this collection
## Not run:
##D sc <- sparkR.init()
##D rdd <- parallelize(sc, 1:10, 2)
##D # The RDD should contain 10 elements
##D length(rdd)
## End(Not run)