model2method <- function(model){
  switch(EXPR = class(model)[1],
         "lm" = "lm",
         "glm" = "glm",
         "nls" = "nls",
         "lmerMod" = "lmer",
         stop("invalid model type found: ", class(model)[1]))
}
