% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/utils.R
\name{list2mat}
\alias{list2mat}
\title{List to Matrix}
\usage{
list2mat(matlist, direction = c("c", "r")[1])
}
\arguments{
\item{matlist}{list of matrices to concatenate}

\item{direction}{character, r or c, to indicate whether should be row-wise (i.e., rbind to match on columns) or column-wise (i.e., cbind to match on rows). Defaults to columnwise (matching on rows) to match convention of SingleCellExperiments}
}
\value{
matrix
}
\description{
List to Matrix
}
\examples{
listofmats <- list(matrix(sample(seq(0,20,1),100,replace = TRUE),nrow = 10),
                   matrix(sample(seq(0,20,1),1000,replace = TRUE),nrow = 10))
newmat <- list2mat(listofmats) # to "cbind" them
listofmats_t <- lapply(listofmats,t)
newmat_t <- list2mat(listofmats_t, 'r') # to "rbind" them
}
