SlideShare une entreprise Scribd logo
1  sur  21
Environmental analysis of crop trialsusing weather data Jacob van Etten
weatherData This package helps us to: 1. Get data from weather stations 2. Interpolate weather data for any location
Get the packages install.packages("weatherData", repos="http://R-Forge.R-project.org") library(weatherData) install.packages(“cropData", repos="http://R- Forge.R-project.org") library(cropData) OR: http://dl.dropbox.com/u/18619554/cropData_1.0.zip http://dl.dropbox.com/u/18619554/weatherData_1.0.zip
Get additional packages install.packages(c(“maps”, “vegan”, “reshape”)) library(maps) library(vegan) library(reshape)
Get the script http://dl.dropbox.com/u/18619554/maizeCA.R http://goo.gl/Y6h7m
Get the data We will use the Global Summary of Day (GSOD) data of NCDC. ftp://ftp.ncdc.noaa.gov/pub/data/gsod/ Downloading takes a lot of time. However, we can selectively download part of the data, in an automatic way. We will show how to do it with a toy example. Then we will use data from disk to continue.
Selecting stations first Select stations within a geographic extent data(stations) locsExtent <-c(0,20,40,60) stationsSelected <- stationsExtent(locsExtent, stations) Show on a map plot(stationsSelected[c("LON","LAT")], pch=3, cex=.5) library(maps) map("world",add=TRUE, interior=F)
Download the data Make a working directory first. setwd(“yourFolder”) Now download the files to this working directory. downloadGSOD(2010, 2010, stations = stationsSelected, silent = FALSE, tries = 2, overwrite = FALSE)  After a few downloads, kill the process by pressing “Esc”. Inspect what you have in “yourFolder” and delete the downloaded files.
Read the data into R Copy the data we have provided you into “yourFolder”. The following lines will make a table and remove missing observations. weather <- makeTableGSOD()  weather <- na.omit(weather) fix(weather)
Getting some trial data The idea is to link weather data to crop trial data. We get some trial data that was incorporated in the package. trial <- read.csv(system.file("external/trialsCA.csv", package="cropData")) locs <- read.csv(system.file("external/locationsCA.csv", package="cropData"))
Make a quick map stationsSelected <- stationsExtent(c(-110,-60,5,25), stations) plot(stationsSelected[c("LON","LAT")], pch=3, cex=.5) points(locs[c("LON","LAT")], pch=15) map("world",add=TRUE, interior=F)
Interpolation We have already seen interpolation at work. Now we use interpolation to estimate weather variables for the trial locations. The function interpolateDailyWeather() automatically interpolates the weather surface for each day and extracts the values for each trial location.
Interpolate Interpolate weather for the years 2003, 2004 and 2005. ipW2003 <- interpolateDailyWeather( tableGSOD = weatherCA,  locations = locs[c("ID", "LON", "LAT", "ALT")],  startDate="2003-5-15",  endDate="2003-9-25",  stations = stationsSelected) Repeat for the other years and then combine: ipW <- rbind(ipW2003,ipW2004,ipW2005)
Duration of T > 30 °C = 4.8 h Minimum is assumed to be at sunrise. Maximum is assumed to be 2 h after solar noon. Thermal stress Temperature (°C) Time
Derive ecophysiologicalvars ?thermalStressDaily Run the example to see how this works. Then: TEMPSTRESS30 <- thermalStressSeasonal(30, ipW, trial, locs) PREC <- precipitationSeasonal(ipW, trial) RADIATION <- radiationSeasonal(ipW, trial, locs) trial <- cbind(trial, TEMPSTRESS30, PREC, RADIATION)
Do RDA on residuals Instead of a normal PCA, we constrain the axes of the PCA with linear combinations of the ecophysiological variables. This type of constrained PCA is called redundancy analysis (RDA)
Do ANOVA m <-  lm(Yield ~ Variety + Location + Plant.m2, data=tr2005)  G + GxE are left over, the rest is filtered out tr2005$Yield <- residuals(m) tr2005 <- tr2005[,c("Variety","Location","Yield")]
Make table ready for RDA tr2005 <- melt(tr2005) tr2005 <- acast(tr2005, Location ~ Variety) env2005 <- trial[trial$Year == 2005, c("Location", "TEMPSTRESS30", "PRECSUM", "PRECCV", "RADIATION")] env2005 <- unique(env2005) rownames(env2005) <- env2005$Location env2005 <- env2005[,-1]
RDA rda2005 <- rda(tr2005, env2005) summary(rda2005) plot(rda2005)
Putting GxE on map It is possible to use the resulting RDA model to predict for any locations. The steps would be: Interpolate weather variables for new location Derive ecophysiological variables Predict yield value for this new location (not taking into account additive environmental effect)
Final remarks Trial data are often noisy – extracting the signal from the data is the objective Many environmental variables are difficult to measure, but can be taken to be “random” in the analysis Many statistical tools exist to link weather data to crop trial data.

Contenu connexe

Tendances

Блохин Леонид - "Mist, как часть Hydrosphere"
Блохин Леонид - "Mist, как часть Hydrosphere"Блохин Леонид - "Mist, как часть Hydrosphere"
Блохин Леонид - "Mist, как часть Hydrosphere"Provectus
 
Monitoring Cloud Foundry: Learning about the Firehose
Monitoring Cloud Foundry: Learning about the FirehoseMonitoring Cloud Foundry: Learning about the Firehose
Monitoring Cloud Foundry: Learning about the FirehoseDustin Ruehle
 
[JAM 1.2] Design & Multitasking (Andrew Solovey)
[JAM 1.2] Design & Multitasking (Andrew Solovey)[JAM 1.2] Design & Multitasking (Andrew Solovey)
[JAM 1.2] Design & Multitasking (Andrew Solovey)Evgeny Kaziak
 
Thoughts on heptio's ark - Contributors Meet 21st Sept 2018
Thoughts on heptio's ark - Contributors Meet 21st Sept 2018Thoughts on heptio's ark - Contributors Meet 21st Sept 2018
Thoughts on heptio's ark - Contributors Meet 21st Sept 2018OpenEBS
 
Climate data in r with the raster package
Climate data in r with the raster packageClimate data in r with the raster package
Climate data in r with the raster packageAlberto Labarga
 
Implementation of k-means clustering algorithm in C
Implementation of k-means clustering algorithm in CImplementation of k-means clustering algorithm in C
Implementation of k-means clustering algorithm in CKasun Ranga Wijeweera
 
Weather scraper for your data warehouse
Weather scraper for your data warehouseWeather scraper for your data warehouse
Weather scraper for your data warehouseFru Louis
 
JTF2018_B30_k8s_operator_nobusue
JTF2018_B30_k8s_operator_nobusueJTF2018_B30_k8s_operator_nobusue
JTF2018_B30_k8s_operator_nobusueNobuhiro Sue
 
Use of django at jolt online v3
Use of django at jolt online v3Use of django at jolt online v3
Use of django at jolt online v3Jaime Buelta
 
Using PostgreSQL for Flight Planning
Using PostgreSQL for Flight PlanningUsing PostgreSQL for Flight Planning
Using PostgreSQL for Flight PlanningBlake Crosby
 
Bending the IoT to your will with JavaScript
Bending the IoT to your will with JavaScriptBending the IoT to your will with JavaScript
Bending the IoT to your will with JavaScriptAll Things Open
 
Chaos Engineering 시작하기 - 윤석찬 (AWS 테크에반젤리스트) :: 한국 카오스엔지니어링 밋업
Chaos Engineering 시작하기 - 윤석찬 (AWS 테크에반젤리스트) ::  한국 카오스엔지니어링 밋업Chaos Engineering 시작하기 - 윤석찬 (AWS 테크에반젤리스트) ::  한국 카오스엔지니어링 밋업
Chaos Engineering 시작하기 - 윤석찬 (AWS 테크에반젤리스트) :: 한국 카오스엔지니어링 밋업Channy Yun
 
Sync with async
Sync with  asyncSync with  async
Sync with asyncprabathsl
 

Tendances (17)

Блохин Леонид - "Mist, как часть Hydrosphere"
Блохин Леонид - "Mist, как часть Hydrosphere"Блохин Леонид - "Mist, как часть Hydrosphere"
Блохин Леонид - "Mist, как часть Hydrosphere"
 
Monitoring Cloud Foundry: Learning about the Firehose
Monitoring Cloud Foundry: Learning about the FirehoseMonitoring Cloud Foundry: Learning about the Firehose
Monitoring Cloud Foundry: Learning about the Firehose
 
Ca counter name
Ca counter nameCa counter name
Ca counter name
 
[JAM 1.2] Design & Multitasking (Andrew Solovey)
[JAM 1.2] Design & Multitasking (Andrew Solovey)[JAM 1.2] Design & Multitasking (Andrew Solovey)
[JAM 1.2] Design & Multitasking (Andrew Solovey)
 
Thoughts on heptio's ark - Contributors Meet 21st Sept 2018
Thoughts on heptio's ark - Contributors Meet 21st Sept 2018Thoughts on heptio's ark - Contributors Meet 21st Sept 2018
Thoughts on heptio's ark - Contributors Meet 21st Sept 2018
 
Climate data in r with the raster package
Climate data in r with the raster packageClimate data in r with the raster package
Climate data in r with the raster package
 
Implementation of k-means clustering algorithm in C
Implementation of k-means clustering algorithm in CImplementation of k-means clustering algorithm in C
Implementation of k-means clustering algorithm in C
 
Weather scraper for your data warehouse
Weather scraper for your data warehouseWeather scraper for your data warehouse
Weather scraper for your data warehouse
 
JTF2018_B30_k8s_operator_nobusue
JTF2018_B30_k8s_operator_nobusueJTF2018_B30_k8s_operator_nobusue
JTF2018_B30_k8s_operator_nobusue
 
Pyspark
PysparkPyspark
Pyspark
 
Use of django at jolt online v3
Use of django at jolt online v3Use of django at jolt online v3
Use of django at jolt online v3
 
Completerecovery
CompleterecoveryCompleterecovery
Completerecovery
 
Using PostgreSQL for Flight Planning
Using PostgreSQL for Flight PlanningUsing PostgreSQL for Flight Planning
Using PostgreSQL for Flight Planning
 
Bending the IoT to your will with JavaScript
Bending the IoT to your will with JavaScriptBending the IoT to your will with JavaScript
Bending the IoT to your will with JavaScript
 
Chaos Engineering 시작하기 - 윤석찬 (AWS 테크에반젤리스트) :: 한국 카오스엔지니어링 밋업
Chaos Engineering 시작하기 - 윤석찬 (AWS 테크에반젤리스트) ::  한국 카오스엔지니어링 밋업Chaos Engineering 시작하기 - 윤석찬 (AWS 테크에반젤리스트) ::  한국 카오스엔지니어링 밋업
Chaos Engineering 시작하기 - 윤석찬 (AWS 테크에반젤리스트) :: 한국 카오스엔지니어링 밋업
 
Practica54
Practica54Practica54
Practica54
 
Sync with async
Sync with  asyncSync with  async
Sync with async
 

En vedette

En vedette (8)

CCAFS Science Meeting A.2 Jerry Nelson - Global futures
CCAFS Science Meeting A.2 Jerry Nelson - Global futuresCCAFS Science Meeting A.2 Jerry Nelson - Global futures
CCAFS Science Meeting A.2 Jerry Nelson - Global futures
 
REDD sticks and carrots in the Brazilian Amazon: assessing costs and liveliho...
REDD sticks and carrots in the Brazilian Amazon: assessing costs and liveliho...REDD sticks and carrots in the Brazilian Amazon: assessing costs and liveliho...
REDD sticks and carrots in the Brazilian Amazon: assessing costs and liveliho...
 
Nitrogen use - Mateete Bekunda
Nitrogen use - Mateete BekundaNitrogen use - Mateete Bekunda
Nitrogen use - Mateete Bekunda
 
CCAFS Science Meeting Item 05 Vladimir Smakhtin - Water storage
CCAFS Science Meeting Item 05 Vladimir Smakhtin - Water storageCCAFS Science Meeting Item 05 Vladimir Smakhtin - Water storage
CCAFS Science Meeting Item 05 Vladimir Smakhtin - Water storage
 
Does secure land tenure save forests?
Does secure land tenure save forests?Does secure land tenure save forests?
Does secure land tenure save forests?
 
The Analogues R-Package - Ramirez-Villegas
The Analogues R-Package - Ramirez-VillegasThe Analogues R-Package - Ramirez-Villegas
The Analogues R-Package - Ramirez-Villegas
 
Pressures on agriculture from climate change mitigation
Pressures on agriculture from climate change mitigationPressures on agriculture from climate change mitigation
Pressures on agriculture from climate change mitigation
 
CCAFS Science Meeting Item 07 Mario Herrero - Household modeling
CCAFS Science Meeting Item 07 Mario Herrero - Household modelingCCAFS Science Meeting Item 07 Mario Herrero - Household modeling
CCAFS Science Meeting Item 07 Mario Herrero - Household modeling
 

Similaire à Environmental analysis of crop trials - Van Etten

rules, events and workflow
rules, events and workflowrules, events and workflow
rules, events and workflowMark Proctor
 
Space Systems & Space Subsystems Fundamentals Technical Training Course Sampler
Space Systems & Space Subsystems Fundamentals Technical Training Course SamplerSpace Systems & Space Subsystems Fundamentals Technical Training Course Sampler
Space Systems & Space Subsystems Fundamentals Technical Training Course SamplerJim Jenkins
 
2021 10-13 i ox query processing
2021 10-13 i ox query processing2021 10-13 i ox query processing
2021 10-13 i ox query processingAndrew Lamb
 
InfluxDB IOx Tech Talks: Query Processing in InfluxDB IOx
InfluxDB IOx Tech Talks: Query Processing in InfluxDB IOxInfluxDB IOx Tech Talks: Query Processing in InfluxDB IOx
InfluxDB IOx Tech Talks: Query Processing in InfluxDB IOxInfluxData
 
e computer notes - Date time functions
e computer notes - Date time functionse computer notes - Date time functions
e computer notes - Date time functionsecomputernotes
 
West-Nile-Virus | Kaggle
West-Nile-Virus | Kaggle West-Nile-Virus | Kaggle
West-Nile-Virus | Kaggle Joyce Rose
 
Dynamically Evolving Systems: Cluster Analysis Using Time
Dynamically Evolving Systems: Cluster Analysis Using TimeDynamically Evolving Systems: Cluster Analysis Using Time
Dynamically Evolving Systems: Cluster Analysis Using TimeMagnify Analytic Solutions
 
TIME SERIES ANALYSIS USING ARIMA MODEL FOR FORECASTING IN R (PRACTICAL)
TIME SERIES ANALYSIS USING ARIMA MODEL FOR FORECASTING IN R (PRACTICAL)TIME SERIES ANALYSIS USING ARIMA MODEL FOR FORECASTING IN R (PRACTICAL)
TIME SERIES ANALYSIS USING ARIMA MODEL FOR FORECASTING IN R (PRACTICAL)Laud Randy Amofah
 
Anais Dotis-Georgiou [InfluxData] | Learn Flux by Example | InfluxDays NA 2021
Anais Dotis-Georgiou [InfluxData] | Learn Flux by Example | InfluxDays NA 2021Anais Dotis-Georgiou [InfluxData] | Learn Flux by Example | InfluxDays NA 2021
Anais Dotis-Georgiou [InfluxData] | Learn Flux by Example | InfluxDays NA 2021InfluxData
 
Intro To PostGIS
Intro To PostGISIntro To PostGIS
Intro To PostGISmleslie
 
Observer Pattern
Observer PatternObserver Pattern
Observer PatternAkshat Vig
 
Please fix the java code (using eclipse)package hw4p1;import jav.pdf
Please fix the java code (using eclipse)package hw4p1;import jav.pdfPlease fix the java code (using eclipse)package hw4p1;import jav.pdf
Please fix the java code (using eclipse)package hw4p1;import jav.pdfinfo961251
 
Automated tests - facts and myths
Automated tests - facts and mythsAutomated tests - facts and myths
Automated tests - facts and mythsWojciech Sznapka
 
Assignment Details There is a .h file on Moodle that provides a defi.pdf
Assignment Details There is a .h file on Moodle that provides a defi.pdfAssignment Details There is a .h file on Moodle that provides a defi.pdf
Assignment Details There is a .h file on Moodle that provides a defi.pdfjyothimuppasani1
 

Similaire à Environmental analysis of crop trials - Van Etten (20)

rules, events and workflow
rules, events and workflowrules, events and workflow
rules, events and workflow
 
Space Systems & Space Subsystems Fundamentals Technical Training Course Sampler
Space Systems & Space Subsystems Fundamentals Technical Training Course SamplerSpace Systems & Space Subsystems Fundamentals Technical Training Course Sampler
Space Systems & Space Subsystems Fundamentals Technical Training Course Sampler
 
2021 10-13 i ox query processing
2021 10-13 i ox query processing2021 10-13 i ox query processing
2021 10-13 i ox query processing
 
InfluxDB IOx Tech Talks: Query Processing in InfluxDB IOx
InfluxDB IOx Tech Talks: Query Processing in InfluxDB IOxInfluxDB IOx Tech Talks: Query Processing in InfluxDB IOx
InfluxDB IOx Tech Talks: Query Processing in InfluxDB IOx
 
e computer notes - Date time functions
e computer notes - Date time functionse computer notes - Date time functions
e computer notes - Date time functions
 
West-Nile-Virus | Kaggle
West-Nile-Virus | Kaggle West-Nile-Virus | Kaggle
West-Nile-Virus | Kaggle
 
Dynamically Evolving Systems: Cluster Analysis Using Time
Dynamically Evolving Systems: Cluster Analysis Using TimeDynamically Evolving Systems: Cluster Analysis Using Time
Dynamically Evolving Systems: Cluster Analysis Using Time
 
PMED Undergraduate Workshop - R Tutorial for PMED Undegraduate Workshop - Xi...
PMED Undergraduate Workshop - R Tutorial for PMED Undegraduate Workshop  - Xi...PMED Undergraduate Workshop - R Tutorial for PMED Undegraduate Workshop  - Xi...
PMED Undergraduate Workshop - R Tutorial for PMED Undegraduate Workshop - Xi...
 
1569909951 (2)
1569909951 (2)1569909951 (2)
1569909951 (2)
 
TIME SERIES ANALYSIS USING ARIMA MODEL FOR FORECASTING IN R (PRACTICAL)
TIME SERIES ANALYSIS USING ARIMA MODEL FOR FORECASTING IN R (PRACTICAL)TIME SERIES ANALYSIS USING ARIMA MODEL FOR FORECASTING IN R (PRACTICAL)
TIME SERIES ANALYSIS USING ARIMA MODEL FOR FORECASTING IN R (PRACTICAL)
 
Anais Dotis-Georgiou [InfluxData] | Learn Flux by Example | InfluxDays NA 2021
Anais Dotis-Georgiou [InfluxData] | Learn Flux by Example | InfluxDays NA 2021Anais Dotis-Georgiou [InfluxData] | Learn Flux by Example | InfluxDays NA 2021
Anais Dotis-Georgiou [InfluxData] | Learn Flux by Example | InfluxDays NA 2021
 
Intro To PostGIS
Intro To PostGISIntro To PostGIS
Intro To PostGIS
 
Observer Pattern
Observer PatternObserver Pattern
Observer Pattern
 
jkfdlsajfklafj
jkfdlsajfklafjjkfdlsajfklafj
jkfdlsajfklafj
 
doc
docdoc
doc
 
Practica 3-ley-de-raoult
Practica 3-ley-de-raoultPractica 3-ley-de-raoult
Practica 3-ley-de-raoult
 
Please fix the java code (using eclipse)package hw4p1;import jav.pdf
Please fix the java code (using eclipse)package hw4p1;import jav.pdfPlease fix the java code (using eclipse)package hw4p1;import jav.pdf
Please fix the java code (using eclipse)package hw4p1;import jav.pdf
 
Automated tests - facts and myths
Automated tests - facts and mythsAutomated tests - facts and myths
Automated tests - facts and myths
 
Assignment Details There is a .h file on Moodle that provides a defi.pdf
Assignment Details There is a .h file on Moodle that provides a defi.pdfAssignment Details There is a .h file on Moodle that provides a defi.pdf
Assignment Details There is a .h file on Moodle that provides a defi.pdf
 
Pdxpugday2010 pg90
Pdxpugday2010 pg90Pdxpugday2010 pg90
Pdxpugday2010 pg90
 

Plus de CCAFS | CGIAR Research Program on Climate Change, Agriculture and Food Security

Plus de CCAFS | CGIAR Research Program on Climate Change, Agriculture and Food Security (20)

CGIAR-AICCRA Knowledge Management Guide (2021)
CGIAR-AICCRA Knowledge Management Guide (2021)CGIAR-AICCRA Knowledge Management Guide (2021)
CGIAR-AICCRA Knowledge Management Guide (2021)
 
Achieving NDC Ambition in Agriculture: How much does agriculture contribute t...
Achieving NDC Ambition in Agriculture: How much does agriculture contribute t...Achieving NDC Ambition in Agriculture: How much does agriculture contribute t...
Achieving NDC Ambition in Agriculture: How much does agriculture contribute t...
 
Achieving NDC Ambition in Agriculture: Mitigation ambition in new & updated N...
Achieving NDC Ambition in Agriculture: Mitigation ambition in new & updated N...Achieving NDC Ambition in Agriculture: Mitigation ambition in new & updated N...
Achieving NDC Ambition in Agriculture: Mitigation ambition in new & updated N...
 
Achieving NDC Ambition in Agriculture: Overview of NDC ambition in the agricu...
Achieving NDC Ambition in Agriculture: Overview of NDC ambition in the agricu...Achieving NDC Ambition in Agriculture: Overview of NDC ambition in the agricu...
Achieving NDC Ambition in Agriculture: Overview of NDC ambition in the agricu...
 
CCAFS and GRA Resources for CLIFF-GRADS 2021
CCAFS and GRA Resources for CLIFF-GRADS 2021CCAFS and GRA Resources for CLIFF-GRADS 2021
CCAFS and GRA Resources for CLIFF-GRADS 2021
 
CSA Monitoring: Understanding adoption, synergies and tradeoffs at farm and h...
CSA Monitoring: Understanding adoption, synergies and tradeoffs at farm and h...CSA Monitoring: Understanding adoption, synergies and tradeoffs at farm and h...
CSA Monitoring: Understanding adoption, synergies and tradeoffs at farm and h...
 
Livestock and sustainability in changing climate: Impacts and global best pra...
Livestock and sustainability in changing climate: Impacts and global best pra...Livestock and sustainability in changing climate: Impacts and global best pra...
Livestock and sustainability in changing climate: Impacts and global best pra...
 
Plant-based protein market in Asia
Plant-based protein market in AsiaPlant-based protein market in Asia
Plant-based protein market in Asia
 
ADB ESLAP case study outputs and synthesis results: Sustainable livestock gui...
ADB ESLAP case study outputs and synthesis results: Sustainable livestock gui...ADB ESLAP case study outputs and synthesis results: Sustainable livestock gui...
ADB ESLAP case study outputs and synthesis results: Sustainable livestock gui...
 
ADB ESLAP Case Study "Dairy value chain in Indonesia"
ADB ESLAP Case Study "Dairy value chain in Indonesia"ADB ESLAP Case Study "Dairy value chain in Indonesia"
ADB ESLAP Case Study "Dairy value chain in Indonesia"
 
Assessment of the environmental sustainability of plant-based meat and pork: ...
Assessment of the environmental sustainability of plant-based meat and pork: ...Assessment of the environmental sustainability of plant-based meat and pork: ...
Assessment of the environmental sustainability of plant-based meat and pork: ...
 
Case study on dairy value chain in China
Case study on dairy value chain in ChinaCase study on dairy value chain in China
Case study on dairy value chain in China
 
Global sustainable livestock investment overview
Global sustainable livestock investment overviewGlobal sustainable livestock investment overview
Global sustainable livestock investment overview
 
The impact of mechanization in smallholder rice production in Nigeria
The impact of mechanization in smallholder rice production in NigeriaThe impact of mechanization in smallholder rice production in Nigeria
The impact of mechanization in smallholder rice production in Nigeria
 
Biodiversity in agriculture for people and planet
Biodiversity in agriculture for people and planetBiodiversity in agriculture for people and planet
Biodiversity in agriculture for people and planet
 
Greenhouse gas (GHG) emissions & priority action in climate mitigation in the...
Greenhouse gas (GHG) emissions & priority action in climate mitigation in the...Greenhouse gas (GHG) emissions & priority action in climate mitigation in the...
Greenhouse gas (GHG) emissions & priority action in climate mitigation in the...
 
Evaluation of Rwanda climate services for agriculture through a gender lens
Evaluation of Rwanda climate services for agriculture through a gender lensEvaluation of Rwanda climate services for agriculture through a gender lens
Evaluation of Rwanda climate services for agriculture through a gender lens
 
Introduction to Climate-Smart Agriculture: Busia County, Kenya
Introduction to Climate-Smart Agriculture: Busia County, KenyaIntroduction to Climate-Smart Agriculture: Busia County, Kenya
Introduction to Climate-Smart Agriculture: Busia County, Kenya
 
Delivering information for national low-emission development strategies: acti...
Delivering information for national low-emission development strategies: acti...Delivering information for national low-emission development strategies: acti...
Delivering information for national low-emission development strategies: acti...
 
Delivering information for national low-emission development strategies: acti...
Delivering information for national low-emission development strategies: acti...Delivering information for national low-emission development strategies: acti...
Delivering information for national low-emission development strategies: acti...
 

Dernier

CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhisoniya singh
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...HostedbyConfluent
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxOnBoard
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 

Dernier (20)

CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptx
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 

Environmental analysis of crop trials - Van Etten

  • 1. Environmental analysis of crop trialsusing weather data Jacob van Etten
  • 2. weatherData This package helps us to: 1. Get data from weather stations 2. Interpolate weather data for any location
  • 3. Get the packages install.packages("weatherData", repos="http://R-Forge.R-project.org") library(weatherData) install.packages(“cropData", repos="http://R- Forge.R-project.org") library(cropData) OR: http://dl.dropbox.com/u/18619554/cropData_1.0.zip http://dl.dropbox.com/u/18619554/weatherData_1.0.zip
  • 4. Get additional packages install.packages(c(“maps”, “vegan”, “reshape”)) library(maps) library(vegan) library(reshape)
  • 5. Get the script http://dl.dropbox.com/u/18619554/maizeCA.R http://goo.gl/Y6h7m
  • 6. Get the data We will use the Global Summary of Day (GSOD) data of NCDC. ftp://ftp.ncdc.noaa.gov/pub/data/gsod/ Downloading takes a lot of time. However, we can selectively download part of the data, in an automatic way. We will show how to do it with a toy example. Then we will use data from disk to continue.
  • 7. Selecting stations first Select stations within a geographic extent data(stations) locsExtent <-c(0,20,40,60) stationsSelected <- stationsExtent(locsExtent, stations) Show on a map plot(stationsSelected[c("LON","LAT")], pch=3, cex=.5) library(maps) map("world",add=TRUE, interior=F)
  • 8. Download the data Make a working directory first. setwd(“yourFolder”) Now download the files to this working directory. downloadGSOD(2010, 2010, stations = stationsSelected, silent = FALSE, tries = 2, overwrite = FALSE) After a few downloads, kill the process by pressing “Esc”. Inspect what you have in “yourFolder” and delete the downloaded files.
  • 9. Read the data into R Copy the data we have provided you into “yourFolder”. The following lines will make a table and remove missing observations. weather <- makeTableGSOD() weather <- na.omit(weather) fix(weather)
  • 10. Getting some trial data The idea is to link weather data to crop trial data. We get some trial data that was incorporated in the package. trial <- read.csv(system.file("external/trialsCA.csv", package="cropData")) locs <- read.csv(system.file("external/locationsCA.csv", package="cropData"))
  • 11. Make a quick map stationsSelected <- stationsExtent(c(-110,-60,5,25), stations) plot(stationsSelected[c("LON","LAT")], pch=3, cex=.5) points(locs[c("LON","LAT")], pch=15) map("world",add=TRUE, interior=F)
  • 12. Interpolation We have already seen interpolation at work. Now we use interpolation to estimate weather variables for the trial locations. The function interpolateDailyWeather() automatically interpolates the weather surface for each day and extracts the values for each trial location.
  • 13. Interpolate Interpolate weather for the years 2003, 2004 and 2005. ipW2003 <- interpolateDailyWeather( tableGSOD = weatherCA, locations = locs[c("ID", "LON", "LAT", "ALT")], startDate="2003-5-15", endDate="2003-9-25", stations = stationsSelected) Repeat for the other years and then combine: ipW <- rbind(ipW2003,ipW2004,ipW2005)
  • 14. Duration of T > 30 °C = 4.8 h Minimum is assumed to be at sunrise. Maximum is assumed to be 2 h after solar noon. Thermal stress Temperature (°C) Time
  • 15. Derive ecophysiologicalvars ?thermalStressDaily Run the example to see how this works. Then: TEMPSTRESS30 <- thermalStressSeasonal(30, ipW, trial, locs) PREC <- precipitationSeasonal(ipW, trial) RADIATION <- radiationSeasonal(ipW, trial, locs) trial <- cbind(trial, TEMPSTRESS30, PREC, RADIATION)
  • 16. Do RDA on residuals Instead of a normal PCA, we constrain the axes of the PCA with linear combinations of the ecophysiological variables. This type of constrained PCA is called redundancy analysis (RDA)
  • 17. Do ANOVA m <- lm(Yield ~ Variety + Location + Plant.m2, data=tr2005) G + GxE are left over, the rest is filtered out tr2005$Yield <- residuals(m) tr2005 <- tr2005[,c("Variety","Location","Yield")]
  • 18. Make table ready for RDA tr2005 <- melt(tr2005) tr2005 <- acast(tr2005, Location ~ Variety) env2005 <- trial[trial$Year == 2005, c("Location", "TEMPSTRESS30", "PRECSUM", "PRECCV", "RADIATION")] env2005 <- unique(env2005) rownames(env2005) <- env2005$Location env2005 <- env2005[,-1]
  • 19. RDA rda2005 <- rda(tr2005, env2005) summary(rda2005) plot(rda2005)
  • 20. Putting GxE on map It is possible to use the resulting RDA model to predict for any locations. The steps would be: Interpolate weather variables for new location Derive ecophysiological variables Predict yield value for this new location (not taking into account additive environmental effect)
  • 21. Final remarks Trial data are often noisy – extracting the signal from the data is the objective Many environmental variables are difficult to measure, but can be taken to be “random” in the analysis Many statistical tools exist to link weather data to crop trial data.