% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/utils_linear_algebra.R
\name{invvecMixes}
\alias{invvecMixes}
\title{Inverse vec for mixtures}
\usage{
invvecMixes(x, nb_comps)
}
\arguments{
\item{x}{vector; make sure that it is correctly sorted beforehand}

\item{nb_comps}{number of components in each mixture}
}
\value{
matrix with \code{nb_comps} columns
}
\description{
Tranforms a vector of component observations into a matrix with one row per mixture and components in colums.
Requires all mixtures to have the same number of components, and all the obervationss from the same mixture to be one after the others, in the same order for each mixture.
}
\examples{
datL <- data.frame(ID = c("g1+g2", "g1+g2", "g1+g2", "g1+g2"),
  focal = c("g1", "g2", "g1", "g2"),
  neighbor = c("g2", "g1", "g2", "g1"),
  block = c("A", "A", "B", "B"),
  yield = c(1, 2, 3, 4)
)
invvecMixes(datL$yield, 2)
}
\author{
Timothee Flutre
}
