SlideShare uma empresa Scribd logo
1 de 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.

Mais conteúdo relacionado

Mais procurados

Блохин Леонид - "Mist, как часть Hydrosphere"
Блохин Леонид - "Mist, как часть Hydrosphere"Блохин Леонид - "Mist, как часть Hydrosphere"
Блохин Леонид - "Mist, как часть Hydrosphere"
Provectus
 
[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
 
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
Alberto 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 C
Kasun Ranga Wijeweera
 

Mais procurados (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
 

Destaque

Destaque (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
 

Semelhante a Environmental analysis of crop trials - Van Etten

e computer notes - Date time functions
e computer notes - Date time functionse computer notes - Date time functions
e computer notes - Date time functions
ecomputernotes
 
West-Nile-Virus | Kaggle
West-Nile-Virus | Kaggle West-Nile-Virus | Kaggle
West-Nile-Virus | Kaggle
Joyce Rose
 
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
info961251
 
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
jyothimuppasani1
 

Semelhante a 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
 

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

Mais 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...
 

Último

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
giselly40
 

Último (20)

A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
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
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
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
 
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
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 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...
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
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
 
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
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
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
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 

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.