% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/indices.R
\name{CC}
\alias{CC}
\title{Change in contribution}
\usage{
CC(
  dat,
  colIDstand = "ID",
  colIDfocal = "focal",
  colProp = "prop",
  colY = "yield"
)
}
\arguments{
\item{dat}{data frame with one yield value per row and with at least four columns: the identifier of each stand, the identifier of the focal genotype or species in each stand, the sowing (plant) proportion of the focal in each stand, and the focal yield in each stand (see the example below); a stand with a single proportion equals to 1 will be interpreted as a monovarietal culture ("pure stand"), a mixture otherwise (and its proportions should sum to 1)}

\item{colIDstand}{column name for the stand identifiers}

\item{colIDfocal}{column name for the focal identifiers}

\item{colProp}{column name for the proportions}

\item{colY}{column name for the yield values}
}
\value{
input data.frame with an extra column named "CC"
}
\description{
Computes the change in contribution (CC) proposed by Williams and McCarthy (2001, \doi{10.1046/j.1440-1703.2001.00368.x}) (this function implements the equation for mixtures with any number of components as written in appendix V of the paper).
}
\examples{
(dat <- data.frame(ID=c("geno1", "geno2", "mixg1g2", "mixg1g2"),
                   focal=c("geno1", "geno2", "geno1", "geno2"),
                   prop=c(1, 1, 0.5, 0.5),
                   yield=c(50, 40, 25, 22)))
CC(dat)
}
\author{
Timothee Flutre
}
