R/stagger_mats.R

Defines functions stagger_mats

Documented in stagger_mats

#' Stagger matrices within a larger, block-diagonal matrix
#'
#' @param ... one or more matrices, separated by commas
#' @return a block-diagonal matrix, with the inputted matrices as blocks on the diagonal.
#' @examples
#' foo <- matrix(rnorm(40000), ncol = 8)
#' block_diag <- stagger_mats(foo, foo)
#' dim(foo)
#' dim(block_diag)
#' @export

stagger_mats <- function(...){
  return(as.matrix(Matrix::bdiag(...)))
}

Try the gemma2 package in your browser

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

gemma2 documentation built on Oct. 24, 2020, 5:06 p.m.