Learn R Programming

wrTopDownFrag (version 1.0.4)

.multMatByColNa: Multiply Values Of Matrix By Its Colnames And Sum By Row

Description

This function allows multiplying values of 'mat' by its colnames and (optionally) summing along rows.

Usage

.multMatByColNa(
  mat,
  sumByRow = TRUE,
  silent = FALSE,
  debug = FALSE,
  callFrom = NULL
)

Value

This functions returns a numeric vector or a matrix if sumByRow=FALSE

Arguments

mat

(matrix) main input

sumByRow

(logical)

silent

(logical) suppress messages

debug

(logical) additional messages for debugging

callFrom

(character) allows easier tracking of messages produced

See Also

convToNum

Examples

Run this code
mat1 <- 3 + matrix(1:4, ncol=2, dimnames=list(letters[1:2], c("3","2")))
.multMatByColNa(mat1)
.multMatByColNa(mat1, sumByRow=FALSE)

Run the code above in your browser using DataLab