monitor_timeInfo {AirMonitor}R Documentation

Get time related information for a monitor

Description

Calculate the local time for a monitor, as well as sunrise, sunset and solar noon times, and create several temporal masks.

The returned dataframe will have as many rows as the length of the incoming UTC time vector and will contain the following columns:

Usage

monitor_timeInfo(monitor = NULL, id = NULL)

Arguments

monitor

mts_monitor object.

id

deviceDeploymentID used to select a single time series found in monitor. – optional if monitor only has one time series.

Details

While the lubridate package makes it easy to work in local timezones, there is no easy way in R to work in "Local Standard Time" (LST) (i.e. never shifting to daylight savings) as is often required when working with air quality data. US EPA regulations mandate that daily averages be calculated based on LST.

The localStdTime_UTC is primarily for use internally and provides an important tool for creating LST daily averages and LST axis labeling.

Value

A dataframe with times and masks.

Examples

library(AirMonitor)

carmel <-
  Carmel_Valley %>%
  monitor_filterDate(20160801, 20160810)

# Create timeInfo object for this monitor
ti <- monitor_timeInfo(carmel)

# Subset the data based on day/night masks
data_day <- carmel$data[ti$day,]
data_night <- carmel$data[ti$night,]

# Build two monitor objects
carmel_day <- list(meta = carmel$meta, data = data_day)
carmel_night <- list(meta = carmel$meta, data = data_night)

# Plot them
carmel_day %>%
  monitor_timeseriesPlot(
    pch = 8,
    col = "goldenrod",
    shadedNight = TRUE
  )

carmel_night %>%
  monitor_timeseriesPlot(
    add = TRUE,
    pch = 16,
    col = "darkblue"
  )

[Package AirMonitor version 0.4.0 Index]