Learn R Programming

bigalgebra (version 3.0.0)

dset: Fill a vector or matrix with a constant value

Description

Fill a vector or matrix with a constant value

Usage

dset(N = NULL, ALPHA, X, INCX = 1L)

Value

Invisibly returns `X` after modification.

Arguments

N

Optional integer specifying the number of elements to modify. Defaults to the length of `X`.

ALPHA

Numeric scalar used to populate `X`.

X

Double-precision vector, matrix or [`bigmemory::big.matrix`] to be filled in place.

INCX

Integer stride between successive elements of `X`.

Examples

Run this code
x <- matrix(0, 2, 3)
dset(ALPHA = 5, X = x)
x

Run the code above in your browser using DataLab