row_wise_subtraction: Row-wise subtraction of a vector to rows of a matrix

View source: R/RcppExports.R

row_wise_subtractionR Documentation

Row-wise subtraction of a vector to rows of a matrix

Description

Calculates the subtraction of a vector to each row of a matrix

Usage

row_wise_subtraction(X, vect)

Arguments

X

matrix (n x m)

vect

vector of length m

Value

an (n x m) matrix, Y, where Y[i,] = X[i,]-vect

Examples

X <- matrix(c(1,2,3,4,5,6,7,8), nrow = 4, ncol = 2, byrow = T)
row_wise_subtraction(X = X, vect = c(1,2))

rchan26/hierarchicalFusion documentation built on Sept. 11, 2022, 10:30 p.m.