# zzz.R

# Suppress NOTES from R CMD check about non-standard evaluation (NSE) variables
if (getRversion() >= "2.15.1") {
  utils::globalVariables(c(
    ".data", "across", "as_label", "bind_cols", "distinct", "element_rect",
    "enquo", "linearHypothesis", "pull", "rename_with", "row_number", "theme",
    "ungroup", "field", "i", "n", "p", "V", "Vbin", "x", "y", "Y", "mod_x", "focus_id",
    "start_day", "end_day", "column_name", "m", "simes_threshold", "score",
    "mk", "treat", "treatment", "Slow", "Sup", ":="
  ))
}
utils::globalVariables(c(
  ".mu_hat", ".res_dev", ".res_pear", ".y",
  "time", "mu", "cluster", "trt_lab",
  "label", "label_short", "xend", "yend",
  # functional_instability variables
  "geno", "env", "mean_mu", "sq_dev", "int_sq_dev",
  "FI", "nFI", "FI_space", "mean_energy_space", "nFI_space",
  "FI_time", "mean_energy_time", "nFI_time",
  "location", "year",
  # plot_functional_instability variables
  "nFI", "nFI_space", "nFI_time"
))
.onLoad <- function(libname, pkgname) {
  utils::globalVariables(c(
    "curve_id_chr", "trt_chr", "y_hat", "u_chr", "id", ".iter",
    "FPC", "prop_var", "cum_var", "curve_id", "DSP", "adjust_group"
  ))
}
# Import from base and recommended packages to suppress NOTES on undefined functions
#' @importFrom stats aggregate coef complete.cases cor.test lm median sd var
#' @importFrom utils install.packages head tail
#' @importFrom car linearHypothesis
#' @importFrom ggplot2 theme element_rect
#' @importFrom dplyr across distinct ungroup pull rename_with bind_cols row_number
#' @importFrom rlang enquo as_label
NULL
