There are several packages and utilities that allow for downloading weather data. Here we use the apsimx package. This package has simple wrappers that ‘get’ weather from different sources:
For more details about getting and working with weather data see the apsimx package.
An alternative way of investigating the growing conditions experienced by crops in a given year would be to summarize the weather data and place it in a historical context. Let us download some weather data first.
We can make simple plots for precipitation or temperature. A filter is used to subset years 2017 to 2020 for easier interpretation.
## Precipitation (or rain)
plot(weather.met, met.var = "rain", cumulative = TRUE,
climatology = TRUE, years = 2017:2020)
There is a summary function for simple display of statistics
## Selecting just a few columns (1, 6, 7, 10) for simplicity
summary(weather.met, years = 2017:2020)[, c(1, 6, 7, 10)]
## year avg_maxt avg_mint rain_sum
## 1 2017 15.79 3.72 814.04
## 2 2018 14.01 2.81 1401.30
## 3 2019 13.75 2.17 998.94
## 4 2020 15.47 3.11 644.34
The apsimx package does not produce complex graphs for weather data. This was included here to allow more detailed interpretation of crop performance data for a given location. In the pacu package we include functions which can summarize data in a historical context.