fst_table: Access a fst file like a regular data.table

Description Usage Arguments Value Examples

View source: R/fst_table.R

Description

Create a fsttable object that can be accessed like a regular data frame. This object is just a reference to the actual data and requires only a small amount of memory. When data is accessed, only the requested subset is read from file. This is possible because the fst file format allows full random access (in columns and rows) to the stored dataset.

Usage

1
fst_table(path, old_format = FALSE)

Arguments

path

Path to a fst file

old_format

Use old_format = TRUE when referencing a fst file that was created with a fst package version lower than 0.8.0

Value

An object of class fsttable

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
## Not run: 
# generate a sample fst file
path <- paste0(tempfile(), ".fst")
write_fst(iris, path)

# create a fsttable object that can be used as a data frame
ft <- fst(path)

# print head and tail
print(ft)

# select columns and rows
x <- ft[10:14, c("Petal.Width", "Species")]

# use the common list interface
ft[TRUE]
ft[c(TRUE, FALSE)]
ft[["Sepal.Length"]]
ft$Petal.Length

# use data frame generics
nrow(ft)
ncol(ft)
dim(ft)
dimnames(ft)
colnames(ft)
rownames(ft)
names(ft)

## End(Not run)

fstpackage/fsttable documentation built on Sept. 10, 2019, 9:18 p.m.