% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/mixing_ability.R
\name{mkZSMA}
\alias{mkZSMA}
\title{Design matrix of SMAs for GMA-SMA models}
\usage{
mkZSMA(df, col, sep = ",", inc_SMA_ii = "no", skipUnusedCols = TRUE)
}
\arguments{
\item{df}{data frame}

\item{col}{name of the column containing the names of pure and mixed stands}

\item{sep}{separator used to separate the genotype names in \code{"col"}}

\item{inc_SMA_ii}{specify how the intra-genotypic SMA should be included, with "no" meaning no SMA_ii, "only_pur" meaning that the SMA_ii is only included in the pure stands (this is model 2 of Forst et al, 2019), "pur_mix" meaning that the SMA_ii is included in both the pure and the mixed stands (this is model 3 of Forst et al, 2019)}

\item{skipUnusedCols}{skip unused columns, i.e., full of zeroes and not present in the data frame}
}
\value{
matrix
}
\description{
Makes a design matrix with the contribution of specific mixing abilities (SMAs).
Before Forst et al (2019), there was only one kind of SMA, the inter-genotypic SMA (SMA_ij).
Forst et al (2019) introduced a second kind of SMA, the intra-genotypic SMA (SMA_ii).
As a result, various design matrices can be made depending on which kinds of SMAs are modeled.
The design is based on the names of pure and mixed stands, in which the genotype names are separated by a specific symbol.
}
\examples{
dat <- data.frame(mix=paste0("mix", 1:3),
                  varieties=c("var3","var1-var3","var1-var2"),
                  pheno=c(10, 7, 9))
(Z_SMA <- mkZSMA(df=dat, col="varieties", sep="-", inc_SMA_ii="only_pur")) # model 2
(Z_SMA <- mkZSMA(df=dat, col="varieties", sep="-", inc_SMA_ii="pur_mix")) # model 3
}
\seealso{
\code{\link{mkZGMA}}, \code{\link{fitGMASMA}}
}
\author{
Timothee Flutre
}
