read.text {SparkR}R Documentation

Create a SparkDataFrame from a text file.

Description

Loads a text file and returns a SparkDataFrame with a single string column named "value". Each line in the text file is a new row in the resulting SparkDataFrame.

Usage

read.text(sqlContext, path)

Arguments

sqlContext

SQLContext to use

path

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

Value

SparkDataFrame

Examples

## Not run: 
sc <- sparkR.init()
sqlContext <- sparkRSQL.init(sc)
path <- "path/to/file.txt"
df <- read.text(sqlContext, path)

## End(Not run)

[Package SparkR version 2.0.0 Index]