% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/pedanalysis.R
\name{pedfclass}
\alias{pedfclass}
\title{Summarize Inbreeding Levels}
\usage{
pedfclass(ped, breaks = c(0.0625, 0.125, 0.25), labels = NULL)
}
\arguments{
\item{ped}{A \code{tidyped} object.}

\item{breaks}{Numeric vector of strictly increasing positive upper bounds for
inbreeding classes. Default is \code{c(0.0625, 0.125, 0.25)}, corresponding
approximately to half-sib, avuncular/grandparent, and full-sib/parent-offspring
mating thresholds. The class \code{"F = 0"} is always kept as a fixed first
level. A final open-ended class \code{"F > max(breaks)"} is always appended
automatically.}

\item{labels}{Optional character vector of interval labels. If \code{NULL},
labels are generated automatically from \code{breaks}. When supplied, its
length must equal \code{length(breaks)}, with each element naming the
bounded interval \code{(breaks[i-1], breaks[i]]}. The open-ended tail
class is always auto-generated and cannot be overridden.}
}
\value{
A \code{data.table} with 3 columns:
\describe{
  \item{\code{FClass}}{An ordered factor. By default it contains 5 levels:
  \code{"F = 0"}, \code{"0 < F <= 0.0625"}, \code{"0.0625 < F <= 0.125"},
  \code{"0.125 < F <= 0.25"}, and \code{"F > 0.25"}. The number of levels
  equals \code{length(breaks) + 2} (the fixed zero class plus one class per
  bounded interval plus the open-ended tail).}
  \item{\code{Count}}{Integer. Number of individuals in each class.}
  \item{\code{Percentage}}{Numeric. Percentage of individuals in each class.}
}
}
\description{
Classifies individuals into inbreeding levels based on their inbreeding 
coefficients (F) according to standard or user-defined thresholds.
}
\details{
The default thresholds follow common pedigree interpretation rules:
\itemize{
  \item \code{F = 0.0625}: approximately the offspring of half-sib mating.
  \item \code{F = 0.125}: approximately the offspring of avuncular or grandparent-grandchild mating.
  \item \code{F = 0.25}: approximately the offspring of full-sib or parent-offspring mating.
}
Therefore, assigning \code{F = 0.25} to the class \code{"0.125 < F <= 0.25"}
is appropriate. If finer reporting is needed, supply custom \code{breaks},
for example to separate \code{0.25}, \code{0.375}, or \code{0.5}.
}
\examples{
tp <- tidyped(simple_ped, addnum = TRUE)
pedfclass(tp)

# Finer custom classes (4 breaks, labels auto-generated)
pedfclass(tp, breaks = c(0.03125, 0.0625, 0.125, 0.25))

# Custom labels aligned to breaks (3 labels for 3 breaks; tail is auto)
pedfclass(tp, labels = c("Low", "Moderate", "High"))

\donttest{
tp_inbred <- tidyped(inbred_ped, addnum = TRUE)
pedfclass(tp_inbred)
}

}
