Skip to contents

Interactive time series plot generation from S3 class ARCHI model object output from impute_grid function. Plots observed, modeled, and imputed time series for selected target site and can add additional panels to show reference sites used for imputation.

Usage

ts_plots(
  impute_output,
  site_no,
  ar = "reversed",
  ms = 2.5,
  error_method = "NSE",
  yax = NA,
  yax_lab = "Value",
  rnd = 2,
  show_topn = c(1)
)

Arguments

impute_output

S3 class ARCHI model object output from impute_grid function.

site_no

single element character vector indexing site to plot. Do not include leading "X." prefix.

ar

if "reversed", will reverse y-axis scale. If logical flag set to TRUE, will revert to default y-axis scaling. Default is "reversed".

ms

marker size. Numeric passed to plotly controlling marker size for observed values. Markers are needed when observed values are bounded by NAs and don't generate lines on the plot. Default is 2.5.

error_method

character string specifying error method to print to plot label. Can be set to "RMSE", "MAE", "NRMSE", "NSE", or "var_ratio". Default is "NSE".

yax

if "log" plot y-axis on log scale. Default is NA (y-axis plotted on linear scale).

yax_lab

input character string for y-axis label. Default is Value.

rnd

number of decimals to round model-error statistics to. Default is 2.

show_topn

numeric vector of the top n correlated reference sites to include in panels below target site times series. For example, c(1:5) shows the top five most correlated reference sites. Default is c(1), which shows the top most correlated reference site.

Value

plotly plot object with inherited classes "plotly" and "htmlwidget".

See also

Author

Maintainer: Zeno F. Levy zlevy@usgs.gov

Examples

 if (FALSE) { # \dontrun{
# load example Long Island dataset
  data(LI_data)

# grid data at monthly timestep using median observed values
  grid <- timestep_grid(data = LI_data, 
                        timestep = "monthly", 
                        agg_method = "median")

# trim grid to remove sites that are less than 35 percent complete
  grid <- trim_grid(grid, data_thresh = 0.35)

# impute grid using default settings
  out <- impute_grid(input_grid = grid)

# generate time series plots for target site "405000073293301"
# with top three most correlated reference sites
  ts_plots(impute_output = out,
           site_no = "405000073293301",
           yax_lab = "Groundwater level, in feet below land surface",
           show_topn = c(1:3))
} # }