read_block_as_sparse | R Documentation |
read_block_as_sparse()
is an internal generic function used by
S4Arrays::read_block()
when is_sparse(x)
is TRUE
.
read_block_as_sparse(x, viewport)
## S4 method for signature 'ANY'
read_block_as_sparse(x, viewport)
x |
An array-like object for which |
viewport |
An ArrayViewport object compatible with |
Like read_block_as_dense()
in the S4Arrays
package, read_block_as_sparse()
is not meant to be called directly
by the end user. The end user should always call the higher-level
user-facing read_block()
function instead.
See ?read_block
in the S4Arrays package
for more information.
Also, like extract_sparse_array()
,
read_block_as_sparse()
should always be called on
an array-like object x
for which is_sparse(x)
is
TRUE
.
For maximum efficiency, read_block_as_sparse()
methods should:
NOT check that is_sparse(x)
is TRUE
.
NOT try to do anything with the dimnames on x
(read_block()
takes care of that).
always operate natively on the sparse representation of the
data in x
, that is, they should never expand
it into a dense representation (e.g. with as.array()).
A block of data as a SparseArray derivative (COO_SparseArray
or SVT_SparseArray) of the same type()
as x
.
read_block
in the S4Arrays package
for the higher-level user-facing function for reading array blocks.
ArrayGrid in the S4Arrays package for ArrayGrid and ArrayViewport objects.
is_sparse
in the S4Arrays package
to check whether an object uses a sparse representation of the
data or not.
SparseArray objects.
S4Arrays::type
in the S4Arrays
package to get the type of the elements of an array-like object.
extract_sparse_array
for the workhorse behind
the default read_block_as_sparse()
method.
dgCMatrix objects implemented in the Matrix package.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.