ArrayOpBase | R Documentation |
ArrayOp class instances denote scidb array operations and operands, hence the name.
Operands can be plain scidb array names or (potentially nested) operations on arrays.
Most ArrayOp class methods return a new ArrayOp instance and the original instance on which methods are invoked from remains the same, i.e. ArrayOp instances are immutable.
One ArrayOp operation may involve one or multiple scidb operators and any number of operands. in another operation. Operands and Opreration results can all be denoted by ArrayOp.
Sub-classes of ArrayOpBase deal with any syntax or operator changes in different SciDB version so that the ArrayOpBase class can provide a unified API on all supported SciDB versions. Currently SciDB V18 and V19 are supported.
Users of arrayop
package shouldn't be concerned with a specific sub-class since
the ScidbConnection
object automatically chooses the correct class version
and creates instances based on the scidb version it connects to.
Get arrayOp instances from the default ScidbConnection object.
See arrayop::get_default_connection
for details.
dims
Dimension names
attrs
Attribute names
selected
Selected dimension and/or attribute names
dtypes
A named list, where key is dim/attr name and value is respective SciDB data type as string
raw_dtypes
A named list, where key is dim/attr name and value is first part of respective SciDB data type as string
dims_n_attrs
Dimension and attribute names
attrs_n_dims
Attribute and dimension names
is_schema_from_scidb
If the array schema is retrieved from SciDB or inferred locally in R
is_scidb_data_frame
Whether current array_op is a regular array or SciDB data frame (array with hidden dimensions; not to be confused with R data frames)
.private
For internal testing only. Do not access this field to avoid unintended consequences!!!
new()
Base class initialize function, to be called in sub-class internally.
Always use ScidbConnection
to get array_op instances.
ArrayOpBase$new( raw_afl, dims = as.character(c()), attrs = as.character(c()), dtypes = list(), dim_specs = list(), ..., meta_list )
raw_afl
AFL expression (array name or operations) as string
dims
A string vector used as dimension names
attrs
A string vector used as attribute names
dtypes
A named list of strings, where names are attribute names and
values are full scidb data types.
E.g. dtypes = list(field_str = "string NOT NULL", field_int32 = "int32")
dim_specs
A named list of string, where names are dimension names
and values are dimension specs.
E.g. dim_sepcs = list(da = "0:*:0:*", chrom = "1:24:0:1")
.
...
A named list of metadata items, where names are used as keys
in private$set_meta
and private$get_meta
functions.
meta_list
A list that stores ArrayOp meta data, e.g. field types If provided, other regular parms are not allowed.
filter()
Create a new ArrayOp instance with filter expressions
Similar to dplyr::filter
, fields are not quoted.
Operators for any type of fields include ==
, !=
,
%in%
, %not_in%
.
To test whether a field is null, use unary operators: is_null
, not_null
.
Special binary operators for string fields include:
%contains%
, %starts_with%
, %ends_with%
, %like%
, where
only %like%
takes a regular expression and other operators escape any special
characters in the right operand.
Operators for numeric fields include: >
, <
, >=
, <=
ArrayOpBase$filter( ..., .expr = NULL, .validate_fields = TRUE, .regex_func = getOption("arrayop.regex_func", default = "regex"), .ignore_case = getOption("arrayop.ignore_case", default = TRUE) )
...
Filter expression(s) in R syntax. These expression(s) are not evaluated in R but first captured then converted to scidb expressions with appropriate syntax.
.expr
A single R expression, or a list of R exprs, or NULL.
If provided, ...
is ignored. Mutiple exprs are joined by 'and'.
This param is useful when we want to pass an already captured R expression.
.validate_fields
Boolean, default TURE, whether to validate fields in filter epxressions. Throw error if invalid fields exist when set to TRUE.
.regex_func
A string of regex function implementation, default 'regex'. Due to scidb compatiblity issue with its dependencies, the regex function from boost library may not be available Currently supported options include 'rsub', and 'regex'
.ignore_case
A Boolean, default TRUE. If TRUE, ignore case in string match patterns. Otherwise, perform case-sensitive regex matches.
A new arrayOp
mutate()
Create a new ArrayOp instance with mutated fields
Similar to dplyr::mutate
, fields of source (self) can be removed or added to the result arrayOp
Any field that are not in the mutate expressions remain unchanged.
ArrayOpBase$mutate(..., .dots = NULL, .sync_schema = TRUE)
...
Named R expressions. Names are field names in the result arrayOp and must not be empty.
Set field = NULL to remove existing fields. E.g. abcd = NULL, def = def
removes
field 'abcd' and keep field 'def'.
Values are R expressions similar to the filter
method.
E.g. a = b + 2, name = first + "-" + last, chrom = if(chrom == 'x') 23 else if(chrom == 'y') 24 else chrom
.dots
A named list of R expressions or NULL. If provided,
the ...
param is ignored. Useful when an a list of mutation expressions is already
created and can be passed around.
.sync_schema
Whether to get the exact schema from scidb. Default TRUE will cause a scidb query to get the schema. Set to FALSE to avoid schema checking.
a new ArrayOp instance
transmute()
Create a new ArrayOp instance with mutated fields
Similar to dplyr::transmute
, only listed fields are retained in the result arrayOp
NOTE: Any field that are not in the mutate expressions will be discarded.
ArrayOpBase$transmute(..., .dots = NULL, .sync_schema = TRUE)
...
R expressions. Names are optional. For each named expression, the name is used as field name in the result arrayOp. Unnamed expressions must be existing field names, unquoted, which result in unchanged source fields of self.
Values are R expressions similar to the filter
method.
E.g. a = b + 2, name = first + "-" + last, chrom = if(chrom == 'x') 23 else if(chrom == 'y') 24 else chrom
.dots
A named list of R expressions or NULL. If provided,
the ...
param is ignored. Useful when an a list of mutation expressions is already
created and can be passed around.
.sync_schema
Whether to get the exact schema from scidb. Default TRUE will cause a scidb query to get the schema. Set to FALSE to avoid schema checking.
a new ArrayOp instance
mutate_by()
Create a ArrayOp instance with the same schema of self, but different cells from 'data_array' for the 'updated_fields'.
ArrayOpBase$mutate_by( data_array, keys = NULL, updated_fields = NULL, .redimension_setting = NULL, .join_setting = NULL )
data_array
An ArrayOp instance that have at least two overlapping fields with self.
keys
Field names in both self and data_array. Cell content of these fields are from the 'self' arrayOp rather than 'data_array'.
updated_fields
Field names in both self and data_array. Cell content of these fields are from the 'data_array', NOT 'self'.
.redimension_setting
A list of strings used as the settings of scidb 'redimension' operator. Only applicable when a 'redimension' is needed.
.join_setting
A list of strings used as the settings of scidb 'join' operator. Only applicable when a 'join' is needed.
A new arrayOp with the same schema as self
inner_join()
Inner join two arrays: 'self' (left) and 'right'
Similar to dplyr::inner_join
, the result arrayOp performs an inner join.
For both left and right arrays, only selected fields are included in the result arrayOp.
If no fields are selected, then all fields are treated as selected.
ArrayOpBase$inner_join( right, by.x = NULL, by.y = NULL, by = NULL, left_alias = "_L", right_alias = "_R", join_mode = "equi_join", settings = NULL )
right
An arrayOp instance
by.x
NULL or a string vector as join keys. If set to NULL, join keys are inferred as shared fields of 'left' and 'right'.
by.y
NULL or a string vector as join keys. If set to NULL, join keys are inferred as shared fields of 'left' and 'right'.
by
NULL or a string vector as join keys. If set to NULL, join keys are inferred as shared fields of 'left' and 'right'. If not NULL, must be fields of both operands.
left_alias
Alias for left array to resolve potential conflicting fields in result
right_alias
Alias for right array to resolve potential conflicting fields in result
join_mode
String 'equi_join' or 'cross_join'. The latter requires join keys are all dimensions of both operands, which is more strigenet than 'equi_join' with the benifit of non-materializing result in scidb.
settings
A named list as join settings. E.g. list(algorithm = "'hash_replicate_right'")
A new arrayOp instance
left_join()
Left join two arrays: 'self' (left) and 'right'
Similar to dplyr::left_join
, the result arrayOp performs a left join.
For both left and right arrays, only selected fields are included in the result arrayOp.
If no fields are selected, then all fields are treated as selected.
ArrayOpBase$left_join( right, by.x = NULL, by.y = NULL, by = NULL, left_alias = "_L", right_alias = "_R", settings = NULL )
right
An arrayOp instance
by.x
NULL or a string vector as join keys. If set to NULL, join keys are inferred as shared fields of 'left' and 'right'.
by.y
NULL or a string vector as join keys. If set to NULL, join keys are inferred as shared fields of 'left' and 'right'.
by
NULL or a string vector as join keys. If set to NULL, join keys are inferred as shared fields of 'left' and 'right'. If not NULL, must be fields of both operands.
left_alias
Alias for left array to resolve potential conflicting fields in result
right_alias
Alias for right array to resolve potential conflicting fields in result
settings
A named list as join settings. E.g. list(algorithm = "'hash_replicate_right'")
A new arrayOp instance
right_join()
Right join two arrays: 'self' (left) and 'right'
Similar to dplyr::right_join
, the result arrayOp performs a right join.
For both left and right arrays, only selected fields are included in the result arrayOp.
If no fields are selected, then all fields are treated as selected.
ArrayOpBase$right_join( right, by.x = NULL, by.y = NULL, by = NULL, left_alias = "_L", right_alias = "_R", settings = NULL )
right
An arrayOp instance
by.x
NULL or a string vector as join keys. If set to NULL, join keys are inferred as shared fields of 'left' and 'right'.
by.y
NULL or a string vector as join keys. If set to NULL, join keys are inferred as shared fields of 'left' and 'right'.
by
NULL or a string vector as join keys. If set to NULL, join keys are inferred as shared fields of 'left' and 'right'. If not NULL, must be fields of both operands.
left_alias
Alias for left array to resolve potential conflicting fields in result
right_alias
Alias for right array to resolve potential conflicting fields in result
settings
A named list as join settings. E.g. list(algorithm = "'hash_replicate_right'")
A new arrayOp instance
full_join()
Full join two arrays: 'self' (left) and 'right'
Similar to dplyr::full_join
, the result arrayOp performs a full join.
For both left and right arrays, only selected fields are included in the result arrayOp.
If no fields are selected, then all fields are treated as selected.
ArrayOpBase$full_join( right, by.x = NULL, by.y = NULL, by = NULL, left_alias = "_L", right_alias = "_R", settings = NULL )
right
An arrayOp instance
by.x
NULL or a string vector as join keys. If set to NULL, join keys are inferred as shared fields of 'left' and 'right'.
by.y
NULL or a string vector as join keys. If set to NULL, join keys are inferred as shared fields of 'left' and 'right'.
by
NULL or a string vector as join keys. If set to NULL, join keys are inferred as shared fields of 'left' and 'right'. If not NULL, must be fields of both operands.
left_alias
Alias for left array to resolve potential conflicting fields in result
right_alias
Alias for right array to resolve potential conflicting fields in result
settings
A named list as join settings. E.g. list(algorithm = "'hash_replicate_right'")
A new arrayOp instance
semi_join()
Return an arrayOp instance with same schema as self and content cells that match the cells of 'df_or_arrayop'.
Similar to dplyr::semi_join
, the result has the same schema as the left
operand 'self' and with content filtered by 'df_or_arrayop'.
params field_mapping
, lower_bound
and upper_bound
, if provided, must be named list,
where the.names are from the source array (i.e. self), and values are from
the right operand df_or_arrayop
ArrayOpBase$semi_join( df_or_arrayop, field_mapping = NULL, lower_bound = NULL, upper_bound = NULL, mode = "auto", filter_threshold = 200L, upload_threshold = 6000L )
df_or_arrayop
An R data frame or arrayOp instance.
field_mapping
NULL or a named list of strings. Only applicable when mode is 'cross_between' mode, ignored in other modes.
lower_bound
NULL or a named list of strings. Only applicable when
mode is 'filter' or 'cross_between'. Names of the list are fields of self,
and value strings are fields or columns of the df_or_arrayop
which are
treated as lower bound to matching fields rather than exact match.
In 'filter' mode, the self fields in lower_bound can be any numeric fields. In 'cross_between' mode, the self fields in lower_bound must be array dimensions.
upper_bound
NULL or a named list of strings. Only applicable when
mode is 'filter' or 'cross_between'. Names of the list are fields of self,
and value strings are fields or columns of the df_or_arrayop
which are
treated as upper bound to matching fields rather than exact match.
In 'filter' mode, the self fields in upper_bound can be any numeric fields. In 'cross_between' mode, the self fields in upper_bound must be array dimensions.
mode
String of 'filter', 'cross_between', 'index_lookup', 'equi_join' or 'auto'
filter_threshold
A number below which the 'filter' mode is used unless a mode other than 'auto' is provided.
upload_threshold
A number below which the 'df_or_arrayop' data frame is compield into a build literal array; otherwise uploaded to scidb as a regular array. Only applicable when 'df_or_arrayop' is an R data frame.
An arrayOp instance
group_by()
Create a new arrayOp with 'group by' fields
The result arrayOp is identical to self except for the 'group_by' fields.
When called before summarize
function, result arrayOp will be converted into grouped_aggregate
operation.
ArrayOpBase$group_by(...)
...
field names as strings or string vectors, which will be merged
into a single string vector with c(...)
An arrayOp instance with group_by fields
summarize()
Create a new arrayOp with aggregated fields
ArrayOpBase$summarize(..., .dots = NULL)
...
aggregation expressions in R syntax. Names of expressions are optional.
If provided, names will be the fields of result arrayOp; otherwise field
names are auto generated by scidb.
Same syntax as ...
in 'filter' and 'mutate' functions.
.dots
a list of aggregation expressions. Similar to '.dots' in 'mutate' and 'transmute'.
A new arrayOp instance
set_auto_fields()
Create a new ArrayOp instance that has auto incremented fields and/or anti-collision fields according to a template arrayOp
If the dimension count, attribute count and data types match between the source(self) and target, then no redimension will be performed, otherwise redimension on the source first.
Redimension mode requires all target fields exist on the source disregard of being attributes or dimensions. Redimension mode does not check on whether source data types match the target because auto data conversion occurs within scidb where necessary/applicable.
ArrayOpBase$set_auto_fields( target, source_auto_increment = NULL, target_auto_increment = NULL, anti_collision_field = NULL, join_setting = NULL, source_anti_collision_dim_spec = NULL )
target
A target ArrayOp the source data is written to.
source_auto_increment
A single named integer, a single string, or NULL. Eg. c(z=0) for field 'z' in the source (ie. self) starting from 0; or a single string 'z' equivalent to c(z=0). If NULL, assume it to be the only dimension in self, normally from an artificial dimension of a build literal or unpack operation.
target_auto_increment
a named number vector or string vector or NULL.
where the name is a target field and value is the starting index.
E.g. c(aid=0, bid=1) means to set auto fields 'aid', 'bid' according to the target fields of the same name.
If 'target' doesn't have a cell, then default values start from 0 and 1 for aid and bid, respectively.
A string vector c("aid", "bid") is equvilant to c(aid=0, bid=0).
NULL means treat all missing fields (absent in self but present in target) as 0-based auto increment fields.
Here the target_auto_increment
param only affects the initial load when the field is still null in the target array.
anti_collision_field
a target dimension name which exsits only to resolve cell collision (ie. cells with the same dimension coordinate).
join_setting
NULL or a named list. When not NULL, it is converted
to settings for scidb equi_join
operator, only applicable when
anti_collision_field
is not NULL.
source_anti_collision_dim_spec
NULL or a string.
If NULL, the dimension spec for the anti-collision dimension in source
(self) is taken from self's schema.
In rare cases, we need to set the dimension spec to control the chunk size
in the 'redimension' operation, e.g. source_anti_collision_dim_spec = "0:*:0:123456"
A new arrayop instance
update()
Update the target array with self's content
Similar behavior to scidb insert operator. Require numbers of attributes and dimensions of self and target arrays match. Field names are irrelevant.
This function only returns an arrayOp with the update operation AFL
encapsulated. No real action is performed in scidb until
source$update(target)$execute()
is called.
ArrayOpBase$update(target)
target
An arrayOp instance where self's content is updated. Must be a persistent array, since it is meanlingless to update an array operation.
A new arrayOp that encapsulates the update operation
overwrite()
Overwrite the target array with self's content
Similar behavior to scidb store operator. Require numbers of attributes and dimensions of self and target arrays match. Field names are irrelevant.
This function only returns an arrayOp with the update operation AFL
encapsulated. No real action is performed in scidb until
source$overwrite(target)$execute()
is called.
Warning: Target's content will be erased and filled with self's content.
ArrayOpBase$overwrite(target)
target
An arrayOp instance where self's content is written to. Must be a persitent array either preexist or does not exist in scidb.
A new arrayOp that encapsulates the overwrite operation
delete_cells()
Create a new ArrayOp instance that encapsulates a delete operation
Implemented by scidb delete
operator.
Operators for any type of fields include ==
, !=
,
%in%
, %not_in%
.
To test whether a field is null, use unary operators: is_null
, not_null
.
Special binary operators for string fields include:
%contains%
, %starts_with%
, %ends_with%
, %like%
, where
only %like%
takes a regular expression and other operators escape any special
characters in the right operand.
Operators for numeric fields include: >
, <
, >=
, <=
ArrayOpBase$delete_cells( ..., .expr = NULL, .regex_func = getOption("arrayop.regex_func", default = "regex"), .ignore_case = getOption("arrayop.ignore_case", default = TRUE) )
...
Filter expression(s) in R syntax. These expression(s) are not evaluated in R but first captured then converted to scidb expressions with appropriate syntax.
.expr
A single R expression, or a list of R exprs, or NULL.
If provided, ...
is ignored. Mutiple exprs are joined by 'and'.
This param is useful when we want to pass an already captured R expression.
.regex_func
A string of regex function implementation, default 'regex'. Due to scidb compatiblity issue with its dependencies, the regex function from boost library may not be available Currently supported options include 'rsub', and 'regex'
.ignore_case
A Boolean, default TRUE. If TRUE, ignore case in string match patterns. Otherwise, perform case-sensitive regex matches.
A new arrayOp
select()
Create a new ArrayOp instance with selected fields
NOTE: this does NOT change the to_afl output, but explicitly state which field(s) should be retained if used in
a parent operation that changes its schema, e.g. inner_join
, left_join
, right_join
and to_df
.
The select
ed fields are passed on to derived ArrayOp instances.
In all join operations, if no field is explicitly select
ed, then all fields are assumed be retained.
In to_df
, if no field is explicitly select
ed, only the attributes are retrieved as data frame columns.
In to_df_all
, if no field is explicitly select
ed, it is equivalent to select all dimensions and attributes.
ArrayOpBase$select(...)
...
Which field(s) to retain.
A new arrayOp
to_df_all()
Download query result of self's AFL string with all self's fields.
ArrayOpBase$to_df_all(arrow = FALSE)
An R data frame with columns from self's dimensions and attributes if no fields are selcted, or the selcted fields.
to_df()
Download query result of self's AFL string with all self's attributes.
ArrayOpBase$to_df(arrow = FALSE)
An R data frame with columns from self's attributes if no fields are selected, or the selcted fields only.
execute()
Execute the AFL string for pure side effect without result returned.
ArrayOpBase$execute()
self
persist()
Persist array operation as scidb array
If self
is a persistent array and no save_array_name
provided, then
self
is returned.
Otherwise, save self's AFL as a new scidb array. This includes two cases:
self
is persistent and save_array_name
is provided, i.e. explicit persistence
self
is array operation(s), then a new array is created regardless of save_array_name
From users perspective,
When we need to ensure a handle to a persistent array and do not care
whether it is a new or existing array, we should leave out
save_array_name
to avoid unnecessary array copying. E.g. conn$array_from_df
may return a build literal or uploaded persistent array, call
conn$array_from_df(...)$persist()
to ensure a persistent array.
When we need to backup an array, then provide a save_array_name
explicitly.
Parameters .gc
and .temp
are only applicable when a new array is created.
ArrayOpBase$persist(save_array_name = NULL, .temp = FALSE, .gc = TRUE)
save_array_name
NULL or String. The new array name to save self's AFL as. If NULL, the array name is randomly generated when a new array is created.
.temp
Boolean, default FALSE. Whether to creaet a temporary scidb array.
.gc
Boolean, default TRUE. Whether to remove the persisted scidb array once the encapsulating arrayOp goes out of scodb in R. Set to FALSE if we need to keep the array indefinitely.
A new arrayOp instance or self; or throw an exception if
save_array_name
is provided and the array already exists
change_schema()
Create a new ArrayOp instance whose schema is the same as the template
.
This operation throws away any fields that do not exist in template
while keeping the self
's data of the
matching fields.
Implemented by scidb redimension
operator, but it allows for partial-fields match if strict=F
.
ArrayOpBase$change_schema(template, strict = TRUE, .setting = NULL)
template
an ArrayOp instance as the schema template.
strict
If TRUE(default), requires self
has all the template
fields.
.setting
a string vector, where each item will be appended to the redimension operand. E.g. .setting = c('false', 'cells_per_chunk: 1234') ==> redimension(source, template, false, cells_per_chunk: 1234)
A new arrayOp instance
drop_dims()
Create a new arrayOp by dropping dimensions of 'self'.
Use mode = 'unpack'
to still keep an artificial dimension in result arrayOp.
The dimension is 0-based, auto-incremented up until self$cell_count() - 1
.
'unpack' mode is useful in taking advantage of this artifical dimension to
auto populate other fields, e.g. in set_auto_fields
.
Use mode = 'flatten'
to return a scidb data frame which has no explicit dimensions.
Result arrayOp in both modes has attributes of self's attributes and dimensions.
ArrayOpBase$drop_dims( mode = "unpack", .chunk_size = NULL, .unpack_dim = dbutils$random_field_name() )
mode
String 'unpack' (default) or 'flatten'.
.chunk_size
NULL or an integer. Converted to the 'chunk_size' param in 'unpack' mode; and 'cells_per_chunk' in 'flatten' mode.
.unpack_dim
NULL (default) or string as the dimension if 'unpack' mode is chosen. NULL defaults to a random field name.
A new arrayOp instance
sync_schema()
Create a new arrayOp with actual schema from SciDB or 'self' if
self$is_schema_from_scidb == T
.
Useful in confirmming the schema of complex array operations. If the array schema is already retrieved from SciDB, then just return self.
ArrayOpBase$sync_schema()
An arrayOp instance
spawn()
Create a new ArrayOp instance using 'self' as a template
This function is mainly for array schema string generation when we want to rename, add, and/or exclude certain fields of self, but still keep other unspecified fields unchanged.
Data types and dimension specs of existing fields are inherited from 'self' unless provided explicitly. New field data types default to NAs unless provided explicitly.
This function is normally used internally for arrayOp generation.
ArrayOpBase$spawn( afl_str = "spawned array_op (as template only)", renamed = NULL, added = NULL, excluded = NULL, dtypes = NULL, dim_specs = NULL )
afl_str
An AFL expression. In case of using the spawned result as a schema template only, the afl_str does not need to be provided. Otherwise, it should conform with the actual resultant arrayOp instance, which is very rare.
renamed
A list of renamed fields where names are old fields and values are new field names.
added
New fields added to result arrayOp. String vector or NULL.
excluded
Fields excluded from self
. String vector or NULL.
dtypes
NULL or a named list of data types for fields of the result arrayOp, where names are field names, values (strings) are data types.
dim_specs
NULL or a named list of array dimension specs, where names are dimension names, values (strings) are dimension specs in scidb format.
A new arrayOp instance
to_afl()
AFL string encapsulated by of the self ArrayOp
AFL can be either an scidb array name or array operation(s) on array(s).
The ArrayOp instance may have 'selected' fields but they are not reflected in the result.
'selected' fields are not reflected here, but determines which fields are retained in to_df()
calls.
ArrayOpBase$to_afl()
an AFL expression string
to_schema_str()
Return a schema representation of the ArrayOp <attr1:type1 [, attr2:type2 ...]> [dim1 [;dim2]]
Unless sync_schema()
is called, the schema may be inferred locally in R to save round trips between R and SciDB server.
SciDB data frames have hidden dimensions that start with $
ArrayOpBase$to_schema_str()
SciDB schema string
limit()
Create a new arrayOp that encapsulate AFL for the first n
cells of 'self'
We still need to append a to_df
call to download the result as data frame.
ArrayOpBase$limit(n = 5, skip = NULL)
n
How many cells to take
skip
How many rows to skip before taking
A new ArrayOp instance
cell_count()
Return the number of cells of 'self'
ArrayOpBase$cell_count()
A number of cells if the AFL that 'self' encapsulates is run.
summarize_array()
Return a data frame of the summary of the 'self' array
Implemented by scidb 'summarize' operator
ArrayOpBase$summarize_array(by_attribute = FALSE, by_instance = FALSE)
by_attribute
Summarize by array attributes
by_instance
Summarize by array scidb instances
return
A data frame of the 'self' array summary
list_versions()
Return a data frame of all self's versions
ArrayOpBase$list_versions()
An R data frame with columns: version_id and timestamp
version()
Get an arrayOp instance that encapsulates a version snapshot of a persistent scidb array
The function does not perform version check in scidb. It only construct an arrayOp locally to represent a specific version. If a non-existent version_id is later used in scidb related operations, an error will be thrown by SciDB.
ArrayOpBase$version(version_id)
version_id
A number of the array version_id
An arrayOp instance with the same schema as self
is_persistent()
Returns whether the current arraOp instance encapsulates a persistent scidb array namne that may or may not exist on the scidb server
No checking with scidb server is performed. Only validate the arrayOp's AFL with regex and see if it matches an array name. E.g. "myNamespace.myArray" or "myArrayInPublicNamespace".
ArrayOpBase$is_persistent()
TRUE or FALSE
exists_persistent_array()
Returns whether the current arraOp instance encapsulates a persistent scidb array that exists on the scidb server
If current arrayOp encapsulates an array operation, then it returns FALSE without checking with scidb server.
ArrayOpBase$exists_persistent_array()
TRUE or FALSE
array_meta_data()
Download the array meta as an R data frame
The array metadata is retrieved from executing the scidb 'show' operator in the array namespace and match for the current array name. Array metadata include fields: "name", "uaid", "aid", "schema", "availability", "temporary", "namespace", "distribution", "etcomp"
ArrayOpBase$array_meta_data()
An R data frame
remove_versions()
Remove array versions of self
Only applicable to persistent arrays. Warning: This function will be executed effectively in scidb without extra 'execute()' and cannot be undone.
ArrayOpBase$remove_versions(version_id = NULL)
version_id
NULL or a number. When set to NULL, all array versions are removed except for the latest one. When set to an number, must be a valid version_id of self, in which case all versions up to the 'version_id' are removed.
NULL
remove_array()
Remove array versions of self
Only applicable to persistent arrays. Warning: This function will be executed effectively in scidb without extra 'execute()' and cannot be undone.
ArrayOpBase$remove_array()
NULL
finalize()
A finalize function executed when the 'self' instance is garbage collected in R
If an arrayOp is marked as .gc = T, then it will be removed from scidb when this function is executed.
We don't normally call this function except in testing.
ArrayOpBase$finalize()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.