add_YEARMODA: Add a column for YEARMODA (or YEARMODAHO) to a data frame

View source: R/add_YEARMODA.R

add_YEARMODAR Documentation

Add a column for YEARMODA (or YEARMODAHO) to a data frame

Description

This function allows users to add a column called YEARMODA or YEARMODAHO to any chillR-formatted data frame

Usage

add_YEARMODA(data, add_hour = FALSE)

Arguments

data

is a data frame at least containing the columns Year, Month, and Day in the case of daily records; and Year, Month, Day, and Hour in the case of hourly records. For now, column names must be spelled as shown in lines above

add_hour

is a boolean parameter defining whether the output should add the YEARMODAHO column. Default is set to FALSE so, even in case of hourly records, the output data frame will only show the YEARMODA column

Value

A data frame

Examples


df <- data.frame(Year = rep(2011, 10),
                 Month = rep(1, 10),
                 Day = seq(1, 10),
                 Tmin = c(10, 12, 11, NA, 21, NA, NA, 10, 20, 23))
                 
add_YEARMODA(data = df, add_hour = FALSE)


EduardoFernandezC/dormancyR documentation built on Aug. 24, 2022, 7:21 a.m.