Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

SparseArraySeed-utils

Operate natively on SparseArraySeed objects


Description

Some utilities to operate natively on SparseArraySeed objects. Mostly for internal use by the DelayedArray package e.g. they support block processed methods for sparse DelayedArray objects like sum(), mean(), which(), etc...

Usage

## S4 method for signature 'SparseArraySeed'
is.na(x)

## S4 method for signature 'SparseArraySeed'
is.infinite(x)

## S4 method for signature 'SparseArraySeed'
is.nan(x)

## S4 method for signature 'SparseArraySeed'
tolower(x)

## S4 method for signature 'SparseArraySeed'
toupper(x)

## S4 method for signature 'SparseArraySeed'
nchar(x, type="chars", allowNA=FALSE, keepNA=NA)

## S4 method for signature 'SparseArraySeed'
anyNA(x, recursive=FALSE)

## S4 method for signature 'SparseArraySeed'
which(x, arr.ind=FALSE, useNames=TRUE)


## <>-<>-<> "Summary" group generic <>-<>-<>

## S4 method for signature 'SparseArraySeed'
max(x, ..., na.rm=FALSE)

## S4 method for signature 'SparseArraySeed'
min(x, ..., na.rm=FALSE)

## S4 method for signature 'SparseArraySeed'
range(x, ..., finite=FALSE, na.rm=FALSE)

## S4 method for signature 'SparseArraySeed'
sum(x, ..., na.rm=FALSE)

## S4 method for signature 'SparseArraySeed'
prod(x, ..., na.rm=FALSE)

## S4 method for signature 'SparseArraySeed'
any(x, ..., na.rm=FALSE)

## S4 method for signature 'SparseArraySeed'
all(x, ..., na.rm=FALSE)


## <>-<>-<> others <>-<>-<>

## S4 method for signature 'SparseArraySeed'
mean(x, na.rm=FALSE)

Arguments

x

A SparseArraySeed object.

type, allowNA, keepNA

See ?base::nchar for a description of these arguments.

recursive

See ?base::anyNA for a description of this argument.

arr.ind

See ?base::which for a description of this argument.

useNames

Ignored.

...

Unsupported.

na.rm

TRUE or FALSE (the default). Should NA's and NaN's be removed?

finite

TRUE or FALSE (the default). Should non-finite values be removed?

Value

See corresponding functions in the base package.

See Also

Examples

## Create a SparseArraySeed object:
dim1 <- 5:3
nzindex1 <- Lindex2Mindex(sample(60, 14), 5:3)
sas1 <- SparseArraySeed(dim1, nzindex1, nzdata=sample(0:13))

## Apply native operations:
sum(sas1)
range(sas1)
mean(sas1)

## Sanity checks:
stopifnot(identical(sum(as.array(sas1)), sum(sas1)))
stopifnot(identical(range(as.array(sas1)), range(sas1)))
stopifnot(identical(mean(as.array(sas1)), mean(sas1)))

DelayedArray

A unified framework for working transparently with on-disk and in-memory array-like datasets

v0.16.3
Artistic-2.0
Authors
Hervé Pagès <hpages.on.github@gmail.com>, with contributions from Peter Hickey <peter.hickey@gmail.com> and Aaron Lun <infinite.monkeys.with.keyboards@gmail.com>
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.