weight.NtoN: Convert Bits to Weights Matrix

Description Usage Arguments Details Examples

View source: R/2-weights.R

Description

This function builds a weights matrix from a binary vector. The resultant weights matrix with have n.amalgams columns and a number of rows based on the size of the binary vector. The resultant weights matrix will have rows that sum to 1. It is possible for row sums or column sums to equal 0.

Usage

1
weight.NtoN(codon, n.amalgams)

Arguments

codon

A binary vector.

n.amalgams

The number of columns in the weights matrix.

Details

The interpretation of this weights matrix is that each component can contribute to multiple amalgam nodes, but must contribute an equal amount to each node.

Examples

1
2
# For 2 amalgams, read as "node 2", "node 1+2", "node 1", "node 0"
weight.NtoN(c(0,1,1,1,1,0,0,0), 2)

tpq/amalgam documentation built on March 14, 2020, 10:27 a.m.