Learn R Programming

PhysioIndexR (version 0.1.0)

mfvst_from_indices: Membership Function Value for Stress Tolerance (MFVST)

Description

This function computes membership function scores (0..1) for each available index column using min–max scaling with direction awareness, then aggregates them into a simple average MFVST. For more details see Vinu et al. (2025) doi:10.1007/s12355-025-01595-1.

Usage

mfvst_from_indices(
  df,
  gen_col = "Gen",
  lower_better = c("TOL", "SSPI", "RSI", "PYR"),
  higher_better = c("STI", "YI", "YSI", "MP", "GMP", "HM", "MRP"),
  weights = NULL,
  robust = FALSE,
  probs = c(0.01, 0.99)
)

Value

A list with $MFVST_indexwise: a data frame that contains per-index membership columns (suffix "_M") and the average MFVST, that is, Mean_MFVST.

Arguments

df

A data frame containing the stress indices (e.g., from all_indices()$all).

gen_col

Name of genotype column; if present, it is included in the output.

lower_better

Character vector listing indices where a lower value is preferred.

higher_better

Character vector listing indices where a higher value is preferred.

weights

Optional named numeric vector of weights for indices.

robust

Logical; if TRUE, winsorizes by probs.

probs

Two-element numeric vector of quantiles for robust winsorization.

References

Vinu, V., Lakshmi Pathy, T., Mahadeva Swamy, H.K. et al. (2025). doi:10.1007/s12355-025-01595-1.

Examples

Run this code
df <- all_indices(
Gen=c("G1","G2","G3"),
YN=c(10,8,5),
YS=c(7,5,3)
)
df1 <- as.data.frame(df$all)
mfvst <- mfvst_from_indices(df1)
print(mfvst)

Run the code above in your browser using DataLab