create_sf: Calculate Season Factor

Description Usage Arguments Details Value

Description

Compute year-spanning or year-bounded season factor by starting month, year-day, or year and year-day.

Usage

1
2
3
4
create_sf(dates, month = as.POSIXlt(dates)$mon + 1L,
  yday = as.POSIXlt(dates)$yday + 1L, year = as.POSIXlt(dates)$year +
  1900L, start_month = c(3, 6, 9, 12), start_yday = c(335, 60, 152,
  244), type = c("month", "ymonth", "yday", "year"))

Arguments

dates

POSIXct vector of length of the data set to be filled, specifying the center-time of each record.

month

Integer (1-12) vector of length of the data set to be filled, specifying the month for each record.

yday

Integer (1-366) vector of length of the data set to be filled, specifying the day of the year for each record.

year

Integer vector of length of the data set to be filled, specifying the year.

start_month

Integer vector specifying the starting month for each season, counting from one. Default is (Dec, Jan, Feb); (Mar, Apr, May); (Jun, Jul, Aug); (Sep, Oct, Nov).

start_yday

Integer vector (1-366) specifying the starting yday for each season in increasing order.

Details

Original names: usCreateSeasonFactorMonth, usCreateSeasonFactorMonthWithinYear, usCreateSeasonFactorYday, usCreateSeasonFactorYdayYear

For type "month": Calculate factors to denote the season for ustar-filtering by specifying starting months, with continuous seasons spanning year boundaries. If Jan is not a starting month, then the first months of each year will be part of the last period in the year. E.g. with the default the fourth period of the first year consists of Jan, Feb, Dec.

For type "ymonth": Calculate factors to denote the season for ustar-filtering by specifying starting months, with seasons not spanning year boundaries. If Jan is not a starting month, then the first months of each year will be part of the last period in the year e.g. with the default the fourth period of the first year consists of Jan, Feb, Dec.

For type "yday": With default parameterization, dates are assumed to denote begin or center of the eddy time period. If working with dates that denote the end of the period, use yday = as.POSIXlt(fGetBeginOfEddyPeriod(dates))$yday.

Internally, the timestamp is shifted 15 minutes after the start of each half hour. When providing the dates argument, the start time may be shifted by dates = data$timestamp + 15 * 60.

Value

For types "month" and "ymonth": an integer vector of length dates, with each unique value representing one season. For types "yday" and "year": an integer vector of length nrow(ds), each unique class representing one season.


grahamstewart12/tidyflux documentation built on June 4, 2019, 7:44 a.m.