cmm: Multiply the columns of a matrix by the corresponding...

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/r-utility-rowcolmult.R

Description

This function performs column-wise matrix by vector multiplication, multiplying the columns of a matrix by the corresponding elements of a vector. It is used in examples presented in the book Cichosz, P. (2015): Data Mining Algorithms: Explained Using R. See Appendix B or http://www.wiley.com/go/data_mining_algorithms for more details.

Usage

1
cmm(m, v)

Arguments

m

a numeric matrix

v

a numeric vector

Details

For each column of m the element-wise multiplication by v is performed, assuming length(v)==nrow(m).

Value

A matrix of the same dimensions as m, with each column obtained by multiplying the corresponding column of m by v.

Author(s)

Pawel Cichosz <p.cichosz@elka.pw.edu.pl>

See Also

rmm

Examples

1
2
cmm(matrix(1:9, ncol=3), 10^(0:2))
cmm(matrix(1:12, ncol=4), 10^(0:3))

42n4/dmr.util documentation built on May 20, 2019, 2:02 p.m.