read.text: Create a SparkDataFrame from a text file.

Description Usage Arguments Details Value Note Examples

View source: R/SQLContext.R

Description

Loads text files and returns a SparkDataFrame whose schema starts with a string column named "value", and followed by partitioned columns if there are any. The text files must be encoded as UTF-8.

Usage

1
read.text(path, ...)

Arguments

path

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

...

additional external data source specific named properties.

Details

Each line in the text file is a new row in the resulting SparkDataFrame.

Value

SparkDataFrame

Note

read.text since 1.6.1

Examples

1
2
3
4
5
6
## Not run: 
sparkR.session()
path <- "path/to/file.txt"
df <- read.text(path)

## End(Not run)

SparkR documentation built on June 3, 2021, 5:05 p.m.