sparse_sqrt {sparsevctrs} | R Documentation |
Calculate sqrt of sparse vectors
Description
Calculate sqrt of sparse vectors
Usage
sparse_sqrt(x)
Arguments
x |
A sparse numeric vector. |
Details
This function, as with any of the other helper functions assumes that the
input x
is a sparse numeric vector. This is done for performance reasons,
and it is thus the users responsibility to perform input checking.
The output will be a double vector regardless of the input type.
Value
A sparse double vector.
Examples
sparse_sqrt(
sparse_double(1000, 1, 10)
)
sparse_sqrt(
sparse_integer(1000, 3, 10, default = 2)
)
sparse_sqrt(
sparse_double(c(10, NA, 11), c(1, 5, 10), 10)
)
[Package sparsevctrs version 0.3.4 Index]