sts_trimDate {MazamaTimeSeries}R Documentation

Trim sts time series object to full days

Description

Trims the date range of a sts object to local time date boundaries which are within the range of data. This has the effect of removing partial-day data records at the start and end of the timeseries and is useful when calculating full-day statistics.

Day boundaries are calculated using the specified timezone or, if NULL, from sts$meta$timezone.

Usage

sts_trimDate(sts = NULL, timezone = NULL)

Arguments

sts

SingleTimeSeries sts object.

timezone

Olson timezone used to interpret dates.

Value

A subset of the incoming sts time series object. (A list with meta and data dataframes.)

Examples

library(MazamaTimeSeries)

UTC_week <- sts_filterDate(
  example_sts,
  startdate = 20180808,
  enddate = 20180815,
  timezone = "UTC"
)

# UTC day boundaries
head(UTC_week$data)

# Trim to local time day boundaries
local_week <- sts_trimDate(UTC_week)
head(local_week$data)


[Package MazamaTimeSeries version 0.3.0 Index]