Learn R Programming

BioCro (version 3.3.0)

add_time_to_weather_data: Add a time component to input

Description

Ensure, if possible, that input data that varies over time has a "time" component. See the documentation for time for more information about this quantity.

It is rare for users to call this function directly because it is called internally by run_biocro.

Usage

add_time_to_weather_data(drivers)

Value

If drivers has doy and hour columns, then it is assumed to represent weather data, and will be modified as follows:

  • A new time column will be computed from doy and hour.

  • The original doy and hour columns will be removed.

In this case, it is expected that the BioCro:format_time direct module will be used to re-compute doy and hour from time.

If drivers does not have doy and hour columns, then

drivers will be returned as-is.

Arguments

drivers

A list or dataframe representing known system parameters that vary over time, such as weather data.

Examples

Run this code
  # Add a time column to the buit-in 2002 weather data
  new_weather <- add_time_to_weather_data(weather[['2002']])

  # Compare column names
  colnames(weather[['2002']])
  colnames(new_weather)

Run the code above in your browser using DataLab