% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/hypr.R
\name{filler_contrasts}
\alias{filler_contrasts}
\alias{which_filler}
\alias{which_target}
\alias{filler_names}
\alias{target_names}
\title{Generate filler contrasts}
\usage{
filler_contrasts(x, how.many = nlevels(x), rescale = FALSE)

which_filler(x)

which_target(x)

filler_names(x)

target_names(x)
}
\arguments{
\item{x}{A hypr object}

\item{how.many}{The total number of contrasts for the new hypr object}

\item{rescale}{If \code{TRUE}, the contrast weights will be rescaled}
}
\description{
Fill free degrees of freedom with orthogonal filler contrasts.
}
\section{Functions}{
\itemize{
\item \code{which_filler()}: Return indices of filler contrasts

\item \code{which_target()}: Return indices of filler contrasts

\item \code{filler_names()}: Return names of filler contrasts

\item \code{target_names()}: Return names of target contrasts

}}
\examples{

# A complete Helmert contrast matrix for 4 levels:
h1 <- hypr(~ (mu2-mu1)/2,
          ~ (mu3-(mu1+mu2)/2)/3,
          ~ (mu4-(mu1+mu2+mu3)/3)/4,
          levels = c("mu1", "mu2", "mu3", "mu4")
          )
cmat(h1)

# An incomplete Helmer contrast matrix (2nd contrast dropped)
h2 <- hypr(~ (mu2-mu1)/2,
           ~ (mu4-(mu1+mu2+mu3)/3)/4,
           levels = c("mu1", "mu2", "mu3", "mu4")
           )
cmat(h2)

# Filling the remaining degree of freedom retrieves the contrast
h3 <- filler_contrasts(h2, rescale = TRUE)
cmat(h3)

stopifnot(all.equal(cmat(h3)[,3], cmat(h1)[,2], check.attributes = FALSE))

}
