### Environmental Covariables (ECs, W matrix)
> * Environmental variables can be used as indicators of the quality of an environment (experiment, location). A double entry table (*q* environments x *k* environmental factors) can be built as suggested by Jarquin et al (2014). Hereafther we will refer to this matrix as **W**, and therefore, it will be obtained by the function *W_matrix*:
```{r}
W_matrix(env.data = df.clim,by.interval = F)
wzxhzdk:0
> * Different statistics can be used, as in *summaryWTH*. The statistic argument is used to select between *mean* or *quantile*. If the selection is made in quantile, the complementary argument *prob* is used to choose the quantiles to be used.
wzxhzdk:1
> * We can perform a Quality Control (QC) based on the maximum sd tolered.
wzxhzdk:2
> * We can perform a Quality Control (QC) based on the maximum sd tolered.
wzxhzdk:3
> * Create for specific variables. To do this, insert the name of the variables in the *id.var* argument.
wzxhzdk:4
> * Or even combine with summaryWTH by using *is.processed=TRUE*:
```{r}
data<-summaryWTH(df.clim,
env.id = 'env',statistic = 'quantile')
W_matrix(env.data = data,is.processed = T)
wzxhzdk:5
> * Typologies can be defined across different time intervals by setting the argument *by.interval = TRUE* (generic time intervals)
wzxhzdk:6
> * Typologies can be defined across **specific** time intervals by setting the argument *by.interval = TRUE* and and defining the time windows (in days after begining of the data) using the function *time.window*
```{r}
env_typing(env.data = df.clim,
env.id = 'env',
var.id='T2M',by.interval = T,time.window = c(0,15,35,65,90,120))
wzxhzdk:7
> * The two-way table of typologies can be plotted based on this [code](
https://raw.githubusercontent.com/allogamous/EnvRtype/master/plot.R)
### **Example 1 : Air Temperature (**T2M**)**
**Option 1: facet by developmental stages**
**Option 2: envirotypes as a combination of environmental factor x cardinal class x developmental stage**
**Option 3: envirotypes per environnment**
### **Example 2 : Solar Radiation (**SRAD**)**
**Option 1: facet by developmental stages**
**Option 2: envirotypes as a combination of environmental factor x cardinal class x developmental stage**
**Option 3: envirotypes per environnment**
### **Example 3 : Valour Pressure Defict (**VPD**)**
**Option 1: facet by developmental stages**
**Option 2: envirotypes as a combination of environmental factor x cardinal class x developmental stage**
**Option 3: envirotypes per environnment**
> * in *
var.id* you can put the names of the desirable variables:
```{r}
env_typing(env.data = df.clim,
var.id = c('T2M','PRECTOT','WS2M'),
env.id='env',by.interval = T)
wzxhzdk:8
> * These cardinals must respect ecophysiological limits for each crop, germplasm or region. For that, we recommend looking for ecophysiology literature and crop growth modeling, such as Soltani and Sinclar (2012) [**Modeling physiology of crop development, growth and yield**](
https://www.amazon.com.br/Modeling-Physiology-Development-Growth-Yield/dp/1845939700); However, we do not always have ecophysiological information about the best possible cardinals ... so we use quantiles!
> * If quantiles = NULL, 1%, 25%, 50%, 99% is assumed
wzxhzdk:9
> * All analyses can also be run considering centered on the mean and scaled x ~ N (0.1)
wzxhzdk:10
[Menu](
https://github.com/allogamous/EnvRtype)