inst/tinytest/setup.R

createMatrix <- function(n, p, dimnames) {
    matrix(data = seq_len(n * p), nrow = n, ncol = p, dimnames = dimnames)
}

createLinkedMatrix <- function(n, p, dimnames, class, nNodes) {
    linkedBy <- ifelse(class == "ColumnLinkedMatrix", "columns", "rows")
    linkedMatrix <- LinkedMatrix(nrow = n, ncol = p, nNodes = nNodes, linkedBy = linkedBy, nodeInitializer = "matrixNodeInitializer")
    linkedMatrix[] <- seq_len(n * p)
    dimnames(linkedMatrix) <- dimnames
    return(linkedMatrix)
}

Try the LinkedMatrix package in your browser

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

LinkedMatrix documentation built on July 8, 2020, 5:53 p.m.