Description Methods Author(s) Examples
provides hybrid data structure for 'fst' file
open()
to be compatible with LazyH5
LazyFST$open(...)
...
ignored
none
close()
close the connection
LazyFST$close(..., .remove_file = FALSE)
...
ignored
.remove_file
whether to remove the file when garbage collected
none
save()
to be compatible with LazyH5
LazyFST$save(...)
...
ignored
none
new()
constructor
LazyFST$new(file_path, transpose = FALSE, dims = NULL, ...)
file_path
where the data is stored
transpose
whether to load data transposed
dims
data dimension, only support 1 or 2 dimensions
...
ignored
get_dims()
get data dimension
LazyFST$get_dims(...)
...
ignored
vector, dimensions
subset()
subset data
LazyFST$subset(i = NULL, j = NULL, ..., drop = TRUE)
i, j, ...
index along each dimension
drop
whether to apply drop
the subset
subset of data
Zhengjia Wang
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | # Data to save, total 8 MB
x <- matrix(rnorm(1000000), ncol = 100)
# Save to local disk
f <- tempfile()
fst::write_fst(as.data.frame(x), path = f, compress = 100)
# Load via LazyFST
dat <- LazyFST$new(file_path = f, dims = c(10000, 100))
pryr::object_size(dat)
#> 236 kB
# Check whether the data is identical
range(dat[] - x)
# The reading of column is very fast
system.time(dat[,100])
# Reading rows might be slow
system.time(dat[1,])
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.