% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/optim_weights.R
\name{optim_weights}
\alias{optim_weights}
\title{Optimizes weighting for the calculation of Proactive Conservation Index}
\usage{
optim_weights(
  sp,
  var_out,
  var_in = NULL,
  weight_out = NULL,
  weight_in = NULL,
  reference,
  type = "both",
  ...
)
}
\arguments{
\item{sp}{character. Names of the taxa being evaluated.}

\item{var_out}{numeric. Threat variables. higher values must indicate increased threat.}

\item{var_in}{numeric. Interacting variables. Will modulate the effect of threat variables.}

\item{weight_out}{numeric. Weights for threat variables}

\item{weight_in}{numeric. Matrix of weights for the combination of interacting variables and threat variables.}

\item{reference}{numeric. Threat reference towards which weights will be optimized.}

\item{type}{character. Optimize weights for threat variables ("out"), for interacting variables ("in") or for both ("both").}

\item{...}{additional arguments to be passed to function 'optim'.}
}
\value{
Vector ("out"), matrix ("in") or list ("both") with optimal weights.
}
\description{
\code{optim_weights} Optimizes weights for calculating Proactive Conservation Index,
}
\details{
The Pearson correlation between the calculated pci and 'reference' is displayed as the weights are optimized.
}
\examples{
# This function takes too long to run here.
#See vignette for a detailed explanation on how to use it.

}
