% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/indices.R
\name{RY}
\alias{RY}
\title{Relative yield (RY)}
\usage{
RY(
  dat,
  colIDstand = "ID",
  colIDfocal = "focal",
  colProp = "prop",
  colY = "yield",
  avgIfReps = FALSE
)
}
\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") and a mixture otherwise; note that contrary to \code{\link{RYP}}, the proportions will not be used for anything else}

\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}

\item{avgIfReps}{if TRUE, replicates of monovarietals will be averaged; if FALSE, the presence of replicates will return an error}
}
\value{
input data.frame with an extra column named "RY"
}
\description{
Computes the "relative yield" (RY) as defined in Fowler (1982, \doi{10.2307/2259865}) citing \href{https://research.wur.nl/en/publications/on-competition/}{de Wit (1960)}: RY_ij = Y_ij / Y_i where Y_ij is the yield of i when mixed with j and Y_i is the yield of i in monovarietal culture.
Note that equation 1 of table 2 in Williams and McCarthy (2001, \doi{10.1046/j.1440-1703.2001.00368.x}) is called "RY" but in fact it corresponds to "RYP" (relative yield per plant).
Note also that the equation for "RY" in Reiss and Drinkwater (2018, \doi{10.1002/eap.1629}) in fact corresponds to "RYM" (relative yield of mixture).
Missing values are forbidden.
}
\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)))
RY(dat)
}
\seealso{
\code{\link{estimRYRep}}, \code{\link{RYP}}, \code{\link{RYT}}, \code{\link{RYM}}
}
\author{
Timothee Flutre
}
