textFile {SparkR}R Documentation

Create an RDD from a text file.

Description

This function reads a text file from HDFS, a local file system (available on all nodes), or any Hadoop-supported file system URI, and creates an RDD of strings from it.

Usage

textFile(sc, path, minSplits = NULL)

Arguments

sc

SparkContext to use

path

Path of file to read. A vector of multiple paths is allowed.

minSplits

Minimum number of splits to be created. If NULL, the default value is chosen based on available parallelism.

Value

RDD where each item is of type character

Examples

## Not run: 
##D  sc <- sparkR.init()
##D  lines <- textFile(sc, "myfile.txt")
## End(Not run)

[Package SparkR version 0.1 Index]