Learn R Programming

tidyweather

A tidyverse-style R package for agricultural weather analysis. Effortlessly summarize, and analyze weather data to support crop modeling, and climate-based decision-making in agriculture.

Installation

From CRAN

install.packages('tidyweather')

From GitHub (development version)

remotes::install_github('byzheng/tidyweather')

Configuration

The tidyweather package provides a flexible options system to customize default behaviors for weather analysis. You can configure settings like frost thresholds and other extreme weather parameters.

Setting Options

Use weather_options$get() to view or and weather_options$set() to modify package settings:

library(tidyweather)

# View all current options
weather_options$get()

# Set frost threshold to 2°C
weather_options$set("extreme.frost_threshold" = 2)

# View updated options
weather_options$get()

Available Options

  • require_full_year: Logical indicating whether to require a full year of data for calculations (default: TRUE)
  • extreme.frost_threshold: Temperature threshold (°C) for frost analysis (default: 0)

Reset Options

To restore all options to their defaults:

weather_options$reset()

Data Sources

This package includes example weather data sourced from the SILO database, operated by the Queensland Department of Environment, Science and Innovation.

Weather data © Queensland Government, SILO climate database.
Licensed under the Creative Commons Attribution 4.0 International License (CC BY 4.0).
Source: https://www.longpaddock.qld.gov.au/silo/

Copy Link

Version

Install

install.packages('tidyweather')

Monthly Downloads

232

Version

0.2.0

License

MIT + file LICENSE

Issues

Pull Requests

Stars

Forks

Maintainer

Bangyou Zheng

Last Published

February 19th, 2026

Functions in tidyweather (0.2.0)

thermal_time

Calculate thermal time using cardinal temperatures
summarise_weather

Summarise Weather Extremes and Key Indicators
interpolation_function

Return a y value from a linear interpolation function
check_extreme_values

Check for extreme values in weather columns
number_frost_day

Calculate the number of frost days
last_frost_day

Calculate the last frost day
read_weather

Read weather records from a file list and/or a folder list
day_length

The time elapsed in hours between the specified sun angle from 90 degree in am and pm. +ve above the horizon, -ve below the horizon.
check_weather

Check weather records for data quality issues
interpolate_3hr

Interpolate 3-Hourly Temperature Values using sine curve.
write_weather

Write weather data to file
ttest_ts

Significantly t-test with auto-correlation for time serial data
check_date_continuity

Check for gaps in date sequence
check_missing_values

Check for missing values in key columns
weather_options

tidyweather options