% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/allocate.basic.R
\name{allocate.basic}
\alias{allocate.basic}
\title{Allocation of Entries to be Selected from Clusters/Groups based on Size for
Core Collection Development}
\usage{
allocate.basic(
  data,
  names,
  group,
  method = c("const", "prop", "log", "sqrt"),
  log.base = exp(1),
  size
)
}
\arguments{
\item{data}{The data as a data frame object. The data frame should possess
one row per individual and columns with the individual names and multiple
trait/character data.}

\item{names}{Name of column with the accession names as a character string.}

\item{group}{Name of column with the accession group/cluster names as a
character string.}

\item{method}{The allocation method. Either \code{"const"} for constant or
\code{"prop"} for proportional or \code{"log"} for logarithmic or
\code{"sqrt"} for square root allocation.}

\item{log.base}{The logarithm base to be used for logarithmic method of
sampling. Default is \code{exp(1)}.}

\item{size}{The desired core set size proportion.}
}
\value{
A named numeric vector specifying the number of entries to be
  selected from each cluster/group. The vector names correspond to the levels
  of the "\code{"group"} column, and values indicate the number of elements
  to be selected from each level.
}
\description{
Estimate the number of entries to be allocated from each cluster/group in the
entire collection to construct a core collection on the basis of
cluster/group size. The following strategies are implemented. \loadmathjax
\itemize{
\item{Constant}
\item{Proportional}
\item{Logarithmic}
\item{Square root}}
The different methods to determine the number of entries from each group or
clusters implemented in \code{allocate.basic} are as follows.
}
\details{
These are different methods which estimate the number of entries only on the
basis of total number of entries in each cluster/group.

\insertCite{brown_core_1989;textual}{SampleCore} proposed the constant (C),
proportional (P) and logarithmic (L) methods and later a similar square root
method was proposed by
\insertCite{huaman_selecting_1999;textual}{SampleCore}.

  \subsection{Constant method}{From an entire collection of size \mjseqn{N},
  to construct a core set of sample size \mjseqn{n}, the number of entries to
  be selected from the \mjseqn{i}th group among \mjseqn{1 \cdots g} groups
  (\mjseqn{n_{i}}) is estimated as below.

  \mjsdeqn{n_{i} = \frac{n}{g} \times N}

  }

  \subsection{Proportional method}{Here the number of entries to be selected
  is proportional to the cluster/group size (\mjseqn{N_{i}}) as
  below.

  \mjsdeqn{n_{i} = n \times \frac{N_{i}}{\sum_{i=1}^{g}N_{i}}}

  \mjsdeqn{n_{i} = n \times \frac{N_{i}}{N}}

  }

  \subsection{Logarithmic method}{Here the number of entries to be selected
  is proportional to the logarithm of the cluster/group size
  (\mjseqn{N_{i}}) as below.

  \mjsdeqn{n_{i} = n \times
  \frac{\log{(N_{i})}}{\sum_{i=1}^{g}\log{(N_{i})}}}

  }

  \subsection{Square root method}{Here the number of entries to
  be selected is proportional to the square root of the cluster/group size
  (\mjseqn{N_{i}}) as below.

  \mjsdeqn{n_{i} = n \times \frac{\sqrt{N_{i}}}{\sum_{i=1}^{g}\sqrt{N_{i}}}}

  }
}
\examples{
# Get data
data("cassava_EC_gp")

set.seed(123)
cassava_EC_gp <- cassava_EC_gp[sample(1:nrow(cassava_EC_gp), 500), ]

data <- cassava_EC_gp

data <- cbind(genotypes = rownames(cassava_EC_gp), cassava_EC_gp)
row.names(data) <- NULL

# Constant allocation
const_out <-
  allocate.basic(data = data, names = "genotypes",
                 group = "Cluster", method = "const",
                 size = 0.2)
const_out

# Proportional allocation
prop_out <-
  allocate.basic(data = data, names = "genotypes",
                 group = "Cluster", method = "prop",
                 size = 0.2)
prop_out

# Logarithmic allocation
log_out <-
  allocate.basic(data = data, names = "genotypes",
                 group = "Cluster", method = "log",
                 size = 0.2)
log_out

# Square root allocation
sqrt_out <-
  allocate.basic(data = data, names = "genotypes",
                 group = "Cluster", method = "sqrt",
                 size = 0.2)
sqrt_out

}
\references{
\insertAllCited
}
\seealso{
\code{\link[SampleCore]{allocate.distance}},
  \code{\link[SampleCore]{allocate.diversity}}
}
