IndexedVector: Indexed vector

Description Details Public fields Methods

Description

An indexed vector

Details

A vector that remembers its original indices.

Public fields

values

vector values

indices

vector indices

Methods

Public methods


Method new()

Create a new IndexedVector object.

Usage
IndexedVector$new(values, indices = NULL)
Arguments
values

a vector of values

indices

optional vector of indices. If not provided, seq_along(values) is used.

Returns

a new IndexedVector object


Method subset()

Subset the vector

Usage
IndexedVector$subset(indices)
Arguments
indices

indices specifying elements to extract

Details

This is a standard subsetting, i.e., 1 returns the first element of the vector, not the one belonging to the first index.

Note that since IndexedVector is an R6 object, this modifies the vector in place.


Method min()

A minimum of vector

Usage
IndexedVector$min()
Details

Method that calculate a minimum of vector values

Returns

minimum of vector values


Method which_min()

Find indices of minimum values

Usage
IndexedVector$which_min(minimum = NULL)
Arguments
minimum

optional min a precalculated minimum.

Details

Find which values are minimum values. Returns vector current (not original) indices

Returns

current indices that have the minimum value


Method substract()

Substract values from vector

Usage
IndexedVector$substract(vec)
Arguments
vec

that is substracted from IndexedVector values

Details

Substract values from vector, equivalent to calling IndexedVector$values - vec


Method len()

Get length of the vector

Usage
IndexedVector$len()
Details

equivalent to calling length(IndexedVector$values)

Returns

length of the IndexedVector


Method sum()

Sum of the vector values

Usage
IndexedVector$sum()
Details

equivalent to calling sum(IndexedVector$values)

Returns

the sum of the IndexedVector


Method clone()

The objects of this class are cloneable with this method.

Usage
IndexedVector$clone(deep = FALSE)
Arguments
deep

Whether to make a deep clone.


bioDS/phyloRNA documentation built on Feb. 21, 2022, 3:28 p.m.