% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/simulate.R
\name{cor_matrix}
\alias{cor_matrix}
\title{Generate a correlation matrix with all off-diagonal values equal to \code{r}}
\usage{
cor_matrix(r, nrow = 2)
}
\arguments{
\item{r}{The correlation to fill in the matrix off-diagonals}

\item{nrow}{The number of rows (and columns) of the resulting matrix}
}
\value{
An \verb{[nrow x nrow]} matrix with values along the diagonal equal
to \code{1} and values off of the diagonal equal to \code{r}
}
\description{
Generate a correlation matrix with all off-diagonal values equal to \code{r}
}
\examples{
cor_matrix(0, nrow = 3)

cor_matrix(-.5, nrow = 4)
}
