Learn R Programming

BigDataStatMeth (version 1.0.3)

bdScalarwproduct: Matrix–scalar weighted product

Description

Multiplies a numeric matrix A by a scalar weight w, returning \(w * A\). The input must be a base R numeric matrix (or convertible to one).

Usage

bdScalarwproduct(A, w)

Value

A numeric matrix with the same dimensions as A.

Arguments

A

Numeric matrix (or object convertible to a dense numeric matrix).

w

Numeric scalar weight.

Examples

Run this code
set.seed(1234)
n <- 5; p <- 3
X <- matrix(rnorm(n * p), n, p)
w <- 0.75
bdScalarwproduct(X, w)

Run the code above in your browser using DataLab