Learn R Programming

phytoclass (version 2.3.1)

Weight_error: Apply weights to F/S matrices by diagonal multiplication

Description

Apply weights to F/S matrices by diagonal multiplication

Usage

Weight_error(S, cm)

Value

A matrix with weighted columns (S %*% diag(cm))

Arguments

S

Matrix to be weighted

cm

Vector of weights to be applied to columns of S

Examples

Run this code
# Create sample matrix and weights
S <- as.matrix(phytoclass::Sm)
Fmat <- as.matrix(phytoclass::Fm)
S_weights <- as.numeric(phytoclass:::Bounded_weights(S))
weighted <- phytoclass:::Weight_error(Fmat, S_weights)

Run the code above in your browser using DataLab