Skip to contents

Plot residuals for a selected site from S3 class ARCHI model object output from impute_grid function. Interactive plot will show timestep for each residual and marginal plot will show marginal histogram of residuals.

Usage

resid_plots(impute_output, site_no, plot_type = "marginal")

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.

plot_type

character specifying plot type. If marginal, returns plot of predictions vs residuals with marginal histogram on y-axis. If interactive, returns plotly plot of predictions vs residuals that is scalable and shows prediction timestep as hover text.

Value

Plot of predictions vs residuals. If plot_type = "marginal" a ggExtraPlot object is returned. If plot_type = "interactive" a plotly object is returned.

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 with default settings
  out <- impute_grid(input_grid = grid)

# plot residuals with "marginal" plot
  resid_plots(impute_output = out,
           site_no = "405000073293301",
           plot_type = "marginal")
           
# plot residuals with "interactive" plot
  resid_plots(impute_output = out,
           site_no = "405000073293301",
           plot_type = "interactive")
 } # }