Learn R Programming

bigalgebra (version 3.0.0)

dsqrt: Element-wise square root

Description

Applies the square root to each entry of `X` in place, supporting both base R and [`bigmemory::big.matrix`] inputs.

Usage

dsqrt(N = NULL, X, INCX = 1L)

Value

Invisibly returns the modified object `X`.

Arguments

N

Optional integer giving the number of elements. Defaults to `length(X)`.

X

Double-precision vector, matrix or [`bigmemory::big.matrix`] input.

INCX

Integer stride for traversing `X`.

Examples

Run this code
vals <- matrix(c(1, 4, 9, 16), 2)
dsqrt(X = vals)
vals

Run the code above in your browser using DataLab