Description Details Public fields Methods
An indexed vector
A vector that remembers its original indices.
valuesvector values
indicesvector indices
new()Create a new IndexedVector object.
IndexedVector$new(values, indices = NULL)
valuesa vector of values
indicesoptional vector of indices. If not provided, seq_along(values) is used.
a new IndexedVector object
subset()Subset the vector
IndexedVector$subset(indices)
indicesindices specifying elements to extract
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.
min()A minimum of vector
IndexedVector$min()
Method that calculate a minimum of vector values
minimum of vector values
which_min()Find indices of minimum values
IndexedVector$which_min(minimum = NULL)
minimumoptional min a precalculated minimum.
Find which values are minimum values. Returns vector current (not original) indices
current indices that have the minimum value
substract()Substract values from vector
IndexedVector$substract(vec)
vecthat is substracted from IndexedVector values
Substract values from vector, equivalent to calling IndexedVector$values - vec
len()Get length of the vector
IndexedVector$len()
equivalent to calling length(IndexedVector$values)
length of the IndexedVector
sum()Sum of the vector values
IndexedVector$sum()
equivalent to calling sum(IndexedVector$values)
the sum of the IndexedVector
clone()The objects of this class are cloneable with this method.
IndexedVector$clone(deep = FALSE)
deepWhether to make a deep clone.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.