\HeaderA{asMatrixWeights}{asMatrixWeights}{asMatrixWeights}
\keyword{hplot}{asMatrixWeights}
\begin{Description}\relax
Convert probe-weights or array-weights to a matrix of weights.
\end{Description}
\begin{Usage}
\begin{verbatim}
asMatrixWeights(weights, dim)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{weights}] numeric matrix of weights, rows corresponding to probes and columns to arrays.
Or vector of probe weights. Or vector of array weights.
\item[\code{dim}] numeric dimension vector of length 2, i.e., the number of probes and the number of arrays.
\end{ldescription}
\end{Arguments}
\begin{Details}\relax
This function converts a vector or probe-weights or a vector of array-weights to a matrix of the correct size.
Probe-weights are repeated across rows while array-weights are repeated down the columns.
If \code{weights} has length equal to the number of probes, it is assumed to contain probe-weights.
If it has length equal to the number of arrays, it is assumed to contain array-weights.
If the number of probes is equal to the number of arrays, then \code{weights} is assumed to contain array-weights if it is a row-vector of the correct size, i.e., if it is a matrix with one row.

This function is used internally by the linear model fitting functions in limma.
\end{Details}
\begin{Value}
Numeric matrix of dimension \code{dim}.
\end{Value}
\begin{Author}\relax
Gordon Smyth
\end{Author}
\begin{SeeAlso}\relax
\code{\LinkA{modifyWeights}{modifyWeights}}.

An overview of functions in LIMMA used for fitting linear models is given in \LinkA{06.LinearModels}{06.LinearModels}.
\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}
asMatrixWeights(1:3,c(4,3))
asMatrixWeights(1:4,c(4,3))
\end{ExampleCode}
\end{Examples}

