SparkR (version 2.1.2)

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

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.

Usage

# S3 method for default
read.text(path, ...)

Arguments

path

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

...

additional external data source specific named properties.

Value

SparkDataFrame

Details

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

Examples

Run this code
# NOT RUN {
sparkR.session()
path <- "path/to/file.txt"
df <- read.text(path)
# }

Run the code above in your browser using DataCamp Workspace