Enviromic_pipeline.md

Envirotyping Pipeline with EnvRtype

last update: Mar 2025

first version: December 21th 2020

# Software ```{r, eval=FALSE} library(devtools) install_github('allogamous/EnvRtype') library(EnvRtype) wzxhzdk:0 # Raw-Data Collection
### 1. Daily weather and elevation > * Creating vectors or a data.frame with latitude, longitude, environment identification and collection time intervals (beginning and end) facilitates the sampling of multiple environments. ```{r, eval=FALSE} env.i = c("1_AN","1_PI","2_AN","2_PI") # environment ID lat = c(-22.875,-22.705,-22.875,-22.705) # latitude coordinates lon = c(-47.997,-47.637,-47.997,-47.637) # longitude coordinates plant.date = c("2016-01-26","2016-01-21","2017-01-12","2017-01-10") # year-month-day harv.date = c('2016-08-01',"2016-07-14","2017-07-25","2017-07-15") wzxhzdk:1 > * Lets consider tropical maize, with cardinals Tbase1 = 8,Tbase2 = 45,Topt1 = 30,Topt2 = 37 ```{r, eval=FALSE} # Processing Raw-weather data df.clim = processWTH(env.data = df.clim,Tbase1 = 8,Tbase2 = 45,Topt1 = 30,Topt2 = 37) head(df.clim) # novel processed df.clim set wzxhzdk:2 > * Finally, you can combine the weather and soil data into a single data.frame ```{r, eval=FALSE} require(reshape2) (soil_data = dcast(soil_data,env~Feature,value.var = 'Soil_Grid')) df.clim = merge(df.clim,soil_data,by='env') wzxhzdk:3
# Environmental Typing (ETs) > * the function env_typing allow the creation of panels of environmental types ```{r, eval=FALSE} source('https://raw.githubusercontent.com/allogamous/EnvRtype/master/R/plot_panel.R') var.i = c('GWETROOT','VPD','T2MDEW','ALLSKY_SFC_PAR_TOT') id.names=c('env','LON','LAT','YYYYMMDD','daysFromStart') ET = env_typing(env.data = df.clim,env.id = 'env',var.id = var.i,id.names = id.names,format = 'wide') plot_panel(ET,title = 'Panel of Environmental Types') wzxhzdk:4
# Environmental Similarity > * env_kernel supports the creation of environmental similarity kernels ```{r, eval=FALSE} K_E = env_kernel(env.data = EC)[[2]] plot_panel(ECs = K_E,title = 'Environmental Similarity') ```


allogamous/EnvRtype documentation built on June 11, 2025, 5:57 a.m.