R/trainMaxnet.R

Defines functions trainMaxnet

trainMaxnet <- function(data,
                        reg = 1,
                        fc = "lqph") {

  result <- SDMmodel(data = data)

  x <- data@data
  p <- data@pa
  model <- maxnet::maxnet(p,
                          x,
                          f = maxnet::maxnet.formula(p, x, classes = fc),
                          regmult = reg,
                          addsamplestobackground = FALSE)

  model_object <- Maxnet(reg = reg,
                         fc = fc,
                         model = model)
  result@model <- model_object

  result
}

Try the SDMtune package in your browser

Any scripts or data that you put into this service are public.

SDMtune documentation built on July 9, 2023, 6:03 p.m.