ptsmooth: Smoothed Depth by Time Plot

Description Usage Arguments Value Examples

View source: R/ptsmooth.R

Description

Interpolates from a series of depth profiles, taken at different dates, times, or locations, and generates a smoothed bivariate time/location (x axis) by depth (y axis, reversed) plot using linear interpolation. Values of the variable being plotted are symbolized by color.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
ptsmooth(
  .dt,
  .x,
  .y,
  .val,
  .res_x = 0.5,
  .res_y = 2,
  y_grow_grid = TRUE,
  y_with_zero = TRUE
)

Arguments

.dt

Data frame containing data to plot. Can be NULL, if all data vectors are found in the enclosing environment.

.x

Value that defines the x (time) coordinate of the plot. Usually a date or other time coordinate. Can be either a vector or the name of a vector in source data frame, not an expression.

.y

Value that defines the (reversed) y coordinate of the plot. Usually the depth. Can be either a numeric vector or the name of a numeric vector in source data frame, not an expression.

.val

Value to be symbolized via the color of the dots. Usually a measured environmental variable that varies with water depth. Can be either a numeric vector or the name of a numeric vector in source data frame, not an expression.

.res_x

Resolution for the plot, in the x, or time dimension.

.res_y

Resolution for the plot in the y or depth dimension.

y_grow_grid

TRUE/FALSE should the grid be expanded to integer depths?

y_with_zero

TRUE/FALSE should the grid include depth = 0?

Value

A ggplot object (S3 class defined by ggplot2)

Examples

1
2
3
4
5
data(dep_sonde)
ptsmooth(dep_sonde, sample_date, depth, temp,
         .res_x = 0.5, .res_y = 5,
         y_grow_grid = TRUE,
         y_with_zero = TRUE)

ccb60/tdggraph documentation built on Dec. 19, 2021, 1:58 p.m.