#' @useDynLib longitree, .registration = TRUE
#' @importFrom stats terms.formula setNames
#' @importFrom utils globalVariables
#' @import graphics
#' @importFrom partykit partysplit partynode party nodeapply nodeids
#' @import ggparty
#' @import ggplot2
#' @importFrom lme4 lmer fixef
NULL

utils::globalVariables(c(
  "tn", "id", "splitvar", "nodesize", "pred", "F_Gweight", "F_GTweight",
  "F_G", "F_GT", "weightedFval", "weightedpval", "afmpval",
  "geom_edge", "geom_edge_label", "geom_node_label", "geom_node_plot",
  "aes", "element_text", "margin", "theme", "theme_classic"
))

.onUnload <- function(libpath) {
  tryCatch(library.dynam.unload("longitree", libpath),
           error = function(e) NULL)
}