plot_precheck: Plots for Cursory Time Series Data Overview

View source: R/Plot_eddy.R

plot_precheckR Documentation

Plots for Cursory Time Series Data Overview

Description

Plot half-hourly time series data of selected variable as a scatter plot with additional settings. Plots are optimized for quick rendering when saved as PDF files.

Usage

plot_precheck(
  x,
  var,
  qrange = c(0.005, 0.995),
  pch = ".",
  cex = 0.5,
  alpha.f = 0.5,
  units = "months",
  interval = "month",
  format = "%b-%y"
)

plot_hh(
  x,
  var,
  pch = ".",
  cex = 1,
  alpha.f = 1,
  units = "months",
  interval = "month",
  format = "%b-%y"
)

Arguments

x

A data frame with column names and "timestamp" column in POSIXt format.

var

A character string. An x column name of the variable to plot on y-axis.

qrange

A numeric vector of length 2, giving the quantile range of y-axis.

pch

Either an integer specifying a symbol or a single character to be used as the default in plotting points. See par for details.

cex

A numerical value giving the amount by which plotting text and symbols should be magnified relative to the default. See par for details.

alpha.f

A numeric value. Factor modifying the color opacity alpha for plotted points; typically in [0,1].

units

A character string. One of the units listed: c("secs", "mins", "hours", "days", "months", "years"). Can be abbreviated. Specifies the rounding applied to first and last record in "timestamp" column of x to produce sensible x-axis ticks and labels.

interval

An interval of the x-axis ticks. See by argument of seq.POSIXt for details. Intervals are counted from the first record in "timestamp" column of x.

format

A character string defining the date-time information format at x-axis.see strptime.

Details

plot_precheck allows to glimpse through the preliminary data with outlying data removed by defined qrange. If you do not want to limit y-axis, set qrange = NULL or qrange = c(0, 1) or use plot_hh.

plot_hh provides a glimpse at all available time series data for given variable.

Examples

set.seed(123)
n <- 17520 # number of half-hourly records in one non-leap year
tstamp <- seq(c(ISOdate(2021,3,20)), by = "30 mins", length.out = n)
x <- data.frame(timestamp = tstamp, H = rf(n, 1, 2, 1))
openeddy::units(x) <- c("", "W m-2")
plot(H ~ timestamp, x)
plot_hh(x, "H")
plot_precheck(x, "H")
plot_precheck(x, "H", units = "days", interval = "2 months", format = "%d-%b")


lsigut/openeddy documentation built on Aug. 5, 2023, 12:25 a.m.