Learn R Programming

EMOTIONS (version 1.0)

ResInd: Estimate resilience indicators (log-variance, lag-1 autocorrelation, and skewness) from daily milk production records

Description

Estimate resilience indicators (log-variance, lag-1 autocorrelation, and skewness) from daily milk production records

Usage

ResInd(
  production_df,
  dim_filter_range = c(1, 7, 203, 210),
  outlier_sd_threshold = 4,
  weight = "weight_AIC",
  trait,
  DIM,
  ID_col
)

Value

A list containing: (1) the daily milk production values after filtering, (2) a list of removed individuals, and (3) a data frame with the resilience indicators

Arguments

production_df

A list containing data frames with the daily production records (actual or predicted) obtained from the LacCurveFit function

dim_filter_range

A numeric vector with the lower and upper limits used to filter out lactation records at the beginning and end of lactation. If no filtering is needed, set the first two values to the minimum days in milk and the last two to the maximum

outlier_sd_threshold

A numeric threshold defining the maximum number of standard deviations allowed for resilience indicator values before considering them outliers

weight

The name of the column containing the selected ensemble prediction. Default is "weight_AIC"

trait

The name of the column containing daily milking records

DIM

The name of the column containing days in milk records

ID_col

The name of the column containing the unique individual IDs