% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/indices.R
\name{RIInet}
\alias{RIInet}
\title{Net Relative interaction index (RIInet)}
\usage{
RIInet(
  dat,
  colIDstand = "ID",
  colIDfocal = "focal",
  colProp = "prop",
  colRII = "RII"
)
}
\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 relative interaction index of the focal.}

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

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

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

\item{colRII}{column name for the RII values}
}
\value{
data.frame with columns \code{colIDstand} and "RIInet"
}
\description{
Computes the net relative interaction index (RII) as defined in \href{https://elifesciences.org/articles/77577}{Stefan et al (2022)}: RIInet = sum_i prop_i RII_i.
Missing values are forbidden.
}
\examples{
sow_density <- 200
(dat <- data.frame(ID=c("geno1", "geno2", "mixg1g2", "mixg1g2"),
                   focal=c("geno1", "geno2", "geno1", "geno2"),
                   prop=c(1, 1, 0.5, 0.5),
                   yield_qt_ha=c(50, 40, 25, 22)))
dat$yield_g_m2 <- (dat$yield_qt_ha / 10^4) * 10^6
dat$yield_g_plant <- dat$yield_g_m2 / (sow_density * dat$prop)
dat <- RII(dat, colY = "yield_g_plant")
RIInet(dat)
}
\seealso{
\code{\link{RII}}
}
\author{
Timothee Flutre
}
