This function calculates the number of frost days from a numeric vector of daily minimum temperatures using tidyverse principles.
Usage
number_frost_day(
.data,
threshold = get_weather_option("extreme.frost_threshold"),
require_full_year = get_weather_option("require_full_year")
)Examples
file <- system.file("extdata/ppd_72150.met", package = "tidyweather")
records <- read_weather(file)
records |>
dplyr::group_by(year) |>
number_frost_day(require_full_year = FALSE)
#> # A tibble: 3 × 2
#> # Groups: year [3]
#> year number_frost_days
#> <dbl> <int>
#> 1 2023 0
#> 2 2024 29
#> 3 2025 9