R/AdjustMatrix.R

# Adjust the columns of the input matrix to have

# the same ordering as in the reference matrix

AdjustMatrix <- function (reference, input) {
  
  if (any (colnames (reference) != colnames (input))) {
    
    Order_node <- match (colnames (reference), colnames (input))
    
    return (input[Order_node, Order_node])
    
  } else {
    
    return (input)
  }
}

Try the MRPC package in your browser

Any scripts or data that you put into this service are public.

MRPC documentation built on April 11, 2022, 5:10 p.m.