Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

makeFormula

Standardized formula maker


Description

makeFormula is an internal biomod2 function that can be useful to help users to build easily some standardized formula used later by statistical models.

Usage

makeFormula(respName, explVar, type = "simple", interaction.level = 0, ...)

Arguments

respName

a character indicating the response variable name

explVar

a matrix or a data.frame, the explanatory variables table that will be considered at modelling step

type

either 'simple', 'quadratic', 'polynomial' or 's_smoother' defining the type of formula you want to build

interaction.level

an integer, the interaction level depth between explanatory variables

...

some additional arguments (see details)

Details

It is advised to give only a subset of explVar table to avoid useless memory consuming. If some explanatory variables are factorial ones, you have to give a data.frame for explVar where associated columns are define as factor.

... argument available values are :

- 'k' the smoothing parameter value (used only if type = 's_smoother') corresponding to k parameter of mgcv s or df gam s arguments.

Value

a link[stats]{formula} class object that can be directly given to most of R statistical models.

Author(s)

Damien Georges

See Also

BIOMOD_ModelingOptions, link[stats]{formula}

Examples

##' create simulated data
myResp <- sample(c(0, 1), 20, replace = TRUE)
myExpl <- 
  matrix(
    runif(60), 
    ncol = 3, 
    dimnames=list(NULL, c('var1', 'var2', 'var3'))
  )

##' create a formula
myFormula <- 
  makeFormula( 
    respName = 'myResp',
    explVar = head(myExpl),
    type = 'quadratic',
    interaction.level = 0
  )
  
##' show formula created
myFormula

biomod2

Ensemble Platform for Species Distribution Modeling

v3.4.6
GPL-2
Authors
Wilfried Thuiller [aut, cre], Damien Georges [aut, cre], Robin Engler [aut], Frank Breiner [aut]
Initial release
2020-02-24

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.