weight.Nto1: 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 at most 1 value per row. It is possible for row sums or column sums to equal 0.

Usage

1
weight.Nto1(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 will only contribute to one amalgam node.

Examples

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

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