R/add_time_to_weather_data.R

Defines functions add_time_to_weather_data

Documented in add_time_to_weather_data

add_time_to_weather_data <- function(drivers)
{
    if ("doy" %in% names(drivers) &&
        "hour" %in% names(drivers) &&
        !"time" %in% names(drivers))
    {
        day_fraction <- drivers$hour / 24.0
        drivers$time <- drivers$doy + day_fraction
    }

    drivers
}

Try the BioCro package in your browser

Any scripts or data that you put into this service are public.

BioCro documentation built on May 29, 2024, 10:30 a.m.