parallelize {SparkR}R Documentation

Create an RDD from a homogeneous list or vector.

Description

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.

Usage

parallelize(sc, coll, numSlices = 1)

Arguments

sc

SparkContext to use

coll

collection to parallelize

numSlices

number of partitions to create in the RDD

Value

an RDD created from this collection

Examples

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

[Package SparkR version 0.1 Index]