distribute_vector_over_matrix: distributes per row each element of m_distribute over the...

View source: R/lib_table.R

distribute_vector_over_matrixR Documentation

distributes per row each element of m_distribute over the elements of m_data pro rata the weight of each element per line in m_data

Description

distributes per row each element of m_distribute over the elements of m_data pro rata the weight of each element per line in m_data

Usage

distribute_vector_over_matrix(m_data, m_distribute)

Arguments

m_data

x n numeric matrix

m_distribute

m x 1 numeric vector

Value

new matrix

Examples

m_distribute = c(1,10)
m_data = matrix(c(1,2,20,10), nrow = 2, byrow = TRUE)
distribute_vector_over_matrix(m_data, m_distribute)

jorritvm/jrutils documentation built on Feb. 14, 2023, 11:33 p.m.