| Title: | Agrometeorological Indices for Daily, Monthly, and Seasonal Time Scales |
|---|---|
| Description: | Provides methods for calculating agrometeorological indices from daily weather data at daily, monthly, and user-defined seasonal time scales. The package includes temperature, rainfall, growing degree days, heat and cold stress, wet and dry spells, extreme rainfall, and seasonal completeness indices, along with functions for meteorological data quality assessment and crop-season definition. For method details see <doi:10.1002/wcc.147> and <doi:10.1038/s41598-026-55293-3>. |
| Authors: | RN Singh [aut], Sonam Sah [aut, cre], Santosha Rathod [aut], Prabhat Kumar [aut], Sudhir Kumar Mishra [aut], Gaurav Chaturvedi [aut] |
| Maintainer: | Sonam Sah <[email protected]> |
| License: | MIT + file LICENSE |
| Version: | 0.1.0 |
| Built: | 2026-10-07 09:29:46 UTC |
| Source: | https://github.com/cran/AgroMetIndices |
Main user-facing function for calculating daily, monthly, or user-defined seasonal agrometeorological indices.
agromet_indices( data, frequency = "daily", seasons = NULL, date = "Date", location = "Location", rain = "Rain", tmax = "Tmax", tmin = "Tmin", tbase, heat_threshold = 35, cold_threshold = 15 )agromet_indices( data, frequency = "daily", seasons = NULL, date = "Date", location = "Location", rain = "Rain", tmax = "Tmax", tmin = "Tmin", tbase, heat_threshold = 35, cold_threshold = 15 )
data |
A daily meteorological data frame. |
frequency |
Calculation frequency: "daily", "monthly", or "seasonal". |
seasons |
A season-definition data frame created using create_seasons(). Required when frequency = "seasonal". |
date |
Name of the date column. |
location |
Name of the location column. |
rain |
Name of the rainfall column. |
tmax |
Name of the maximum temperature column. |
tmin |
Name of the minimum temperature column. |
tbase |
Base temperature for GDD calculation. |
heat_threshold |
Heat-stress threshold. |
cold_threshold |
Cold-stress threshold. |
Calculated agrometeorological indices.
data(weather_daily) # Daily indices daily <- agromet_indices( weather_daily, frequency = "daily", tbase = 10 ) head(daily) # Monthly indices monthly <- agromet_indices( weather_daily, frequency = "monthly", tbase = 10 ) head(monthly) # Seasonal indices seasons <- rbind( create_seasons("Kharif", "01-06", "31-10"), create_seasons("Rabi", "01-11", "31-03") ) seasonal <- agromet_indices( weather_daily, frequency = "seasonal", seasons = seasons, tbase = 10 ) head(seasonal$indices)data(weather_daily) # Daily indices daily <- agromet_indices( weather_daily, frequency = "daily", tbase = 10 ) head(daily) # Monthly indices monthly <- agromet_indices( weather_daily, frequency = "monthly", tbase = 10 ) head(monthly) # Seasonal indices seasons <- rbind( create_seasons("Kharif", "01-06", "31-10"), create_seasons("Rabi", "01-11", "31-03") ) seasonal <- agromet_indices( weather_daily, frequency = "seasonal", seasons = seasons, tbase = 10 ) head(seasonal$indices)
Assigns each daily observation to a user-defined crop season and determines the corresponding SeasonYear.
assign_season(data, seasons, date = "Date")assign_season(data, seasons, date = "Date")
data |
A data frame containing a date column. |
seasons |
A data frame created using create_seasons(). |
date |
Name of the date column. |
The input data frame with Season and SeasonYear columns.
data(weather_daily) seasons <- create_seasons( season_name = c("Kharif", "Rabi"), start = c("01-06", "01-11"), end = c("31-10", "31-03") ) seasonal_data <- assign_season( weather_daily, seasons = seasons ) head(seasonal_data) table(seasonal_data$Season)data(weather_daily) seasons <- create_seasons( season_name = c("Kharif", "Rabi"), start = c("01-06", "01-11"), end = c("31-10", "31-03") ) seasonal_data <- assign_season( weather_daily, seasons = seasons ) head(seasonal_data) table(seasonal_data$Season)
Checks the structure and completeness of daily meteorological data.
check_meteo_data( data, date = "Date", location = "Location", rain = "Rain", tmax = "Tmax", tmin = "Tmin" )check_meteo_data( data, date = "Date", location = "Location", rain = "Rain", tmax = "Tmax", tmin = "Tmin" )
data |
A data frame containing Date, Location, Rain, Tmax and Tmin. |
date |
Name of the date column. |
location |
Name of the location column. |
rain |
Name of the rainfall column. |
tmax |
Name of the maximum temperature column. |
tmin |
Name of the minimum temperature column. |
A list containing data summary and data-quality information.
data(weather_daily) qc <- check_meteo_data(weather_daily) qc$summarydata(weather_daily) qc <- check_meteo_data(weather_daily) qc$summary
Calculates seasonal completeness while distinguishing dates that fall outside a location's available observation period from dates missing within that period.
check_season_completeness(data, seasons, date = "Date")check_season_completeness(data, seasons, date = "Date")
data |
A data frame containing Date, Season and SeasonYear. |
seasons |
A data frame created using create_seasons(). |
date |
Name of the date column. |
A data frame containing seasonal completeness information.
data(weather_daily) seasons <- create_seasons( season_name = c("Kharif", "Rabi"), start = c("01-06", "01-11"), end = c("31-10", "31-03") ) seasonal_data <- assign_season( weather_daily, seasons = seasons ) season_qc <- check_season_completeness( seasonal_data, seasons = seasons ) season_qcdata(weather_daily) seasons <- create_seasons( season_name = c("Kharif", "Rabi"), start = c("01-06", "01-11"), end = c("31-10", "31-03") ) seasonal_data <- assign_season( weather_daily, seasons = seasons ) season_qc <- check_season_completeness( seasonal_data, seasons = seasons ) season_qc
Creates a standardized table of user-defined crop seasons.
create_seasons(season_name, start, end)create_seasons(season_name, start, end)
season_name |
Character vector of season names. |
start |
Character vector of season start dates in "DD-MM" format. |
end |
Character vector of season end dates in "DD-MM" format. |
A data frame containing season definitions.
seasons <- create_seasons( season_name = c("Kharif", "Rabi"), start = c("01-06", "01-11"), end = c("31-10", "31-03") ) seasonsseasons <- create_seasons( season_name = c("Kharif", "Rabi"), start = c("01-06", "01-11"), end = c("31-10", "31-03") ) seasons
Calculates daily mean temperature, diurnal temperature range, growing degree days, temperature-stress indicators, and precipitation-related indices.
daily_agromet( data, date = "Date", location = "Location", tmax = "Tmax", tmin = "Tmin", tbase, heat_threshold = 35, cold_threshold = 15 )daily_agromet( data, date = "Date", location = "Location", tmax = "Tmax", tmin = "Tmin", tbase, heat_threshold = 35, cold_threshold = 15 )
data |
A data frame containing Date, Location, Rain, Tmax and Tmin. |
date |
Name of the date column. |
location |
Name of the location column. |
tmax |
Name of the maximum temperature column. |
tmin |
Name of the minimum temperature column. |
tbase |
Base temperature for GDD calculation. |
heat_threshold |
Temperature above which a heat-stress day is recorded. |
cold_threshold |
Temperature below which a cold-stress day is recorded. |
A data frame containing the original data and calculated indices.
data(weather_daily) daily <- daily_agromet( weather_daily, tbase = 10 ) head(daily)data(weather_daily) daily <- daily_agromet( weather_daily, tbase = 10 ) head(daily)
Aggregates daily agrometeorological indices to monthly values. The function calculates monthly temperature, rainfall, growing degree days, precipitation extremes, consecutive dry and wet days, heat and cold stress indicators, and monthly data-quality information.
monthly_agromet( data, date = "Date", location = "Location", tmax = "Tmax", tmin = "Tmin" )monthly_agromet( data, date = "Date", location = "Location", tmax = "Tmax", tmin = "Tmin" )
data |
A data frame containing daily agrometeorological indices, typically produced by [daily_agromet()]. |
date |
Name of the date column. |
location |
Name of the location column. |
tmax |
Name of the maximum temperature column. |
tmin |
Name of the minimum temperature column. |
A data frame containing monthly agrometeorological indices and monthly data-quality information.
data(weather_daily) daily <- daily_agromet( weather_daily, tbase = 10 ) monthly <- monthly_agromet( daily ) head(monthly)data(weather_daily) daily <- daily_agromet( weather_daily, tbase = 10 ) monthly <- monthly_agromet( daily ) head(monthly)
Calculates seasonal agrometeorological indices for user-defined crop seasons. Only complete seasons are used for calculation.
seasonal_agromet(data, seasons, date = "Date", location = "Location")seasonal_agromet(data, seasons, date = "Date", location = "Location")
data |
A data frame containing daily agrometeorological indices, typically produced by [daily_agromet()]. |
seasons |
A data frame created using [create_seasons()]. |
date |
Name of the date column. |
location |
Name of the location column. |
A list containing two elements:
indices, a data frame containing seasonal agrometeorological
indices, and qc, a data frame containing seasonal
completeness information.
data(weather_daily) daily <- daily_agromet( weather_daily, tbase = 10 ) seasons <- create_seasons( season_name = c("Kharif", "Rabi"), start = c("01-06", "01-11"), end = c("31-10", "31-03") ) seasonal <- seasonal_agromet( daily, seasons = seasons ) head(seasonal$indices) head(seasonal$qc)data(weather_daily) daily <- daily_agromet( weather_daily, tbase = 10 ) seasons <- create_seasons( season_name = c("Kharif", "Rabi"), start = c("01-06", "01-11"), end = c("31-10", "31-03") ) seasonal <- seasonal_agromet( daily, seasons = seasons ) head(seasonal$indices) head(seasonal$qc)
A two-year daily weather dataset for Kashi, India, containing daily rainfall, maximum temperature, and minimum temperature.
weather_dailyweather_daily
A data frame with 731 rows and 5 variables:
Date of observation.
Location name.
Daily rainfall (mm).
Daily maximum air temperature (°C).
Daily minimum air temperature (°C).
The dataset covers 1 January 2023 to 31 December 2024, with 731 daily observations, including the leap day in 2024.
Local daily weather dataset used for demonstration of the AgroMeteoIndices package.
data(weather_daily) head(weather_daily)data(weather_daily) head(weather_daily)