Subset parts of bigdist

bigdist_subset(x, index, file)

Arguments

x

Object of class 'bigdist'

index

Indexes of the bigdist to be subset as a bigdist

file

(string) Name of the backing file to be created. Do not include trailing ".bk". See details for the backup file format.

Details

The filename format is of the form <somename>_<size>_<type>.bk where size is the number of observations and type is the data type like 'double', 'float'.

Examples

set.seed(1) amat <- matrix(rnorm(1e3), ncol = 10) td <- tempdir() temp <- bigdist(mat = amat, file = file.path(td, "temp_ex8"))
#> ----
#> Location: /tmp/RtmpNBdlQr/temp_ex8_100_float.bk
#> Size on disk: 0 GB
#> Computing distances ...
#> Completed!
#> ----
temp_subset <- bigdist_subset(temp, index = 21:30, file = file.path(td, "temp_ex9")) temp_subset
#> $fbm #> A Filebacked Big Matrix of type 'float' with 10 rows and 10 columns. #> #> attr(,"class") #> [1] "bigdist"
temp_subset$fbm$backingfile
#> [1] "/tmp/RtmpNBdlQr/temp_ex9_10_float.bk"