read.text {SparkR}R Documentation

Create a DataFrame from a text file.

Description

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

Usage

read.text(sqlContext, path)

Arguments

sqlContext

SQLContext to use

path

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

Value

DataFrame

Examples

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

[Package SparkR version 1.6.1 Index]