readfst: Read fst or HDD files as DT

View source: R/core.R

readfstR Documentation

Read fst or HDD files as DT

Description

This is the function read_fst but with automatic conversion to data.table. It also allows to read hdd data.

Usage

readfst(path, columns = NULL, from = 1, to = NULL, confirm = FALSE)

Arguments

path

Path to fst file – or path to hdd data. For hdd files, there is a

columns

Column names to read. The default is to read all columns. Ignored for hdd files.

from

Read data starting from this row number. Ignored for hdd files.

to

Read data up until this row number. The default is to read to the last row of the stored data set. Ignored for hdd files.

confirm

If the HDD file is larger than ten times the variable getHdd_extract.cap(), then by default an error is raised. To anyway read the data, use confirm = TRUE. You can set the data cap with the function setHdd_extract.cap.

Details

This function reads one or several .fst files and place them in a single data table.

Value

This function returns a data table located in memory. It allows to read in memory the hdd data saved on disk.

Author(s)

Laurent Berge

See Also

See hdd, sub-.hdd and cash-.hdd for the extraction and manipulation of out of memory data. For importation of HDD data sets from text files: see txt2hdd.

See hdd_slice to apply functions to chunks of data (and create HDD objects) and hdd_merge to merge large files.

To create/reshape HDD objects from memory or from other HDD objects, see write_hdd.

To display general information from HDD objects: origin, summary.hdd, print.hdd, dim.hdd and names.hdd.

Examples


# Toy example with the iris data set

# writing a hdd file
hdd_path = tempfile()
write_hdd(iris, hdd_path, rowsPerChunk = 30)

# reading the full data in memory
base_mem = readfst(hdd_path)

# is equivalent to:
base_hdd = hdd(hdd_path)
base_mem_bis = base_hdd[]



hdd documentation built on Aug. 25, 2023, 5:19 p.m.