SparseArraySeed-utils: Operate natively on SparseArraySeed objects

Description Usage Arguments Value See Also Examples

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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
## 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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
## 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 documentation built on March 25, 2021, 6:01 p.m.