% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/get_data.R
\name{calculate_mrt}
\alias{calculate_mrt}
\title{Calculate Minimum Residence Time (MRT) for Species}
\usage{
calculate_mrt(species = "ALL")
}
\arguments{
\item{species}{Character vector or single string specifying species names to calculate MRT for.
Use \code{"ALL"} to calculate MRT for all species in the database. Defaults to \code{"ALL"}.}
}
\value{
A data frame with columns:
\itemize{
\item \code{acc_species_name}: The accepted species name.
\item \code{first_year}: The first recorded year of the species.
\item \code{mrt}: Minimum Residence Time (current year minus first recorded year).
}

If a specified species is not found in the database, a message is printed indicating the missing species.
Returns \code{NULL} if no matching records are found.
}
\description{
Computes the Minimum Residence Time (MRT) for species based on their first recorded year
in the ILORA database. MRT is defined as the difference between the current year
and the species' first record year. Users can calculate MRT for specific species or all species.
}
\examples{
\donttest{
# Calculate MRT for all species
all_species_mrt <- calculate_mrt(species = "ALL")

# Calculate MRT for specific species
species <- c("Species A", "Species B", "Species C")
specific_species_mrt <- calculate_mrt(species)
}

}
