Learn R Programming

nanoparquet (version 0.4.2)

read_parquet: Read a Parquet file into a data frame

Description

Converts the contents of the named Parquet file to a R data frame.

Usage

read_parquet(file, col_select = NULL, options = parquet_options())

Value

A data.frame with the file's contents.

Arguments

file

Path to a Parquet file. It may also be an R connection, in which case it first reads all data from the connection, writes it into a temporary file, then reads the temporary file, and deletes it. The connection might be open, it which case it must be a binary connection. If it is not open, then read_parquet() will open it and also close it in the end.

col_select

Columns to read. It can be a numeric vector of column indices, or a character vector of column names. It is an error to select the same column multiple times. The order of the columns in the result is the same as the order in col_select.

options

Nanoparquet options, see parquet_options().

See Also

See write_parquet() to write Parquet files, nanoparquet-types for the R <-> Parquet type mapping. See read_parquet_info(), for general information, read_parquet_schema() for information about the columns, and read_parquet_metadata() for the complete metadata.

Examples

Run this code
file_name <- system.file("extdata/userdata1.parquet", package = "nanoparquet")
parquet_df <- nanoparquet::read_parquet(file_name)
print(str(parquet_df))

Run the code above in your browser using DataLab