makeFormula: Standardized formula maker

Description Usage Arguments Details Value Author(s) See Also Examples

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

1
2
3
4
5
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's advise 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 availables values are :

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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
# 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 documentation built on May 2, 2019, 5:08 p.m.