Learn R Programming

lazyarray (version 1.1.0)

ClassLazyArray: Internal Class definition for LazyArray

Description

Internal class definition of lazy array objects

Arguments

Active bindings

meta_name

file name to store meta information

min_version

minimal version supported, for backward compatibility concerns

version

current version of lazy data instance

dim

dimension of the data

dimnames

dimension names of the data

ndim

length of dimensions

can_write

is array read-only or writable

storage_path

directory where the data is stored at

Methods

Public methods

Method print()

Override print method

Usage

ClassLazyArray$print(...)

Arguments

...

ignored

Returns

self instance

Method new()

Constructor

Usage

ClassLazyArray$new(path, read_only = TRUE, meta_name = "lazyarray.meta")

Arguments

path

directory to store data into

read_only

whether modification is allowed

meta_name

meta file to store the data into

Method flag_auto_clean()

Set auto clean flag

Usage

ClassLazyArray$flag_auto_clean(auto)

Arguments

auto

logical whether the data on hard disk will be automatically cleaned

Method finalize()

Override finalize method

Usage

ClassLazyArray$finalize()

Method remove_data()

Remove data on hard disk

Usage

ClassLazyArray$remove_data(force = FALSE, warn = TRUE)

Arguments

force

whether to force remove the data

warn

whether to show warning if not fully cleaned

Method make_writable()

Make instance writable

Usage

ClassLazyArray$make_writable()

Method make_readonly()

Make instance read-only

Usage

ClassLazyArray$make_readonly()

Method set_dim()

Set dim and dimnames of the array

Usage

ClassLazyArray$set_dim(dim, dimnames)

Arguments

dim

integer vector of the array dimension; see dim

dimnames

named list of dimension names; see dimnames

Method get_file_format()

Partition format, currently only 'fst' is supported

Usage

ClassLazyArray$get_file_format()

Method get_storage_format()

Data storage format, expected to be one of the followings: 'double', 'integer', 'character', or 'complex'

Usage

ClassLazyArray$get_storage_format()

Method is_multi_part()

Whether partitioned based on the last dimension

Usage

ClassLazyArray$is_multi_part()

Method partition_dim()

Returns dimension of each partition

Usage

ClassLazyArray$partition_dim()

Method get_partition_fpath()

Get partition path

Usage

ClassLazyArray$get_partition_fpath(part, full_path = TRUE)

Arguments

part

integer representing the partition

full_path

whether return the full system path

Returns

Character file name or full path

Method @set_data()

Internal method to set data

Usage

ClassLazyArray$@set_data(value, ...)

Arguments

value

vector of data to be set

...

index set

Method set_compress_level()

Set compression level

Usage

ClassLazyArray$set_compress_level(level)

Arguments

level

from 0 to 100. 0 means no compression, 100 means max compression

Method get_compress_level()

Get compression level

Usage

ClassLazyArray$get_compress_level()

Method @get_data()

Internal method to read data

Usage

ClassLazyArray$@get_data(..., drop = TRUE)

Arguments

...

index set

drop

whether to drop dimension after subset, default is true

Method @sample_data()

Internal method to obtain a sample data to be used to determine storage mode

Usage

ClassLazyArray$@sample_data()

Method clone()

The objects of this class are cloneable with this method.

Usage

ClassLazyArray$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.