char_plot: CharAnalysis output figures

char_plotR Documentation

CharAnalysis output figures

Description

Nine output figures mirroring the MATLAB CharAnalysis v2.0 plots. Function names follow R snake_case conventions.

Usage

char_plot_peaks(out)

char_plot_fire_history(out)

char_plot_cumulative(out)

char_plot_fri(out)

char_plot_zones(out)

char_plot_raw(out)

char_plot_thresh_diag(out)

char_plot_sni(out)

char_plot_all(out, save = FALSE, out_dir = NULL, width = 11, height = 8.5)

Arguments

out

Named list returned by [CharAnalysis()]. Must contain charcoal, pretreatment, peak_analysis, char_thresh, post, and site.

save

Logical. If TRUE, each figure is saved as a PDF in out_dir. Default FALSE.

out_dir

Directory for saved PDFs. Required when save = TRUE; no default. Use tempdir() for a transient location, or supply a path of your choosing. Ignored when save = FALSE.

width, height

PDF dimensions in inches. Defaults: 11 x 8.5.

Details

[char_plot_raw()]

Figure 1 (allFigures only): C_raw, C_interpolated, and C_background smoothing options.

[char_plot_thresh_diag()]

Figure 2 (allFigures only): Local threshold determination diagnostics (5x5 window grid).

[char_plot_peaks()]

Figure 3: Resampled CHAR with background trend (top) and C_peak with thresholds and peak markers (bottom).

[char_plot_sni()]

Figure 4: Sensitivity to alternative thresholds and signal-to-noise index.

[char_plot_cumulative()]

Figure 5: Cumulative peaks through time.

[char_plot_fri()]

Figure 6: FRI distributions by zone with Weibull model fits.

[char_plot_fire_history()]

Figure 7: Peak magnitude (top), FRIs through time with smoothed FRI and CI ribbon (middle), and smoothed fire frequency (bottom).

[char_plot_zones()]

Figure 8: Between-zone comparisons of raw CHAR distributions (CDF and box plots).

[char_plot_all()]

Convenience wrapper: produces all figures and optionally saves them as PDF files.

Requires the ggplot2 package. Multi-panel layout uses patchwork if available; otherwise panels are printed separately with a message.

Value

Individual figure functions each return a patchwork / ggplot2 object. char_plot_all() returns a named list of all figure objects.

See Also

[CharAnalysis()], [char_post_process()]

Examples


  # Run pipeline on the bundled example dataset, then plot:
  params_file <- system.file("validation", "CO_charParams.csv",
                             package = "CharAnalysis")
  out <- CharAnalysis(params_file)
  char_plot_peaks(out)
  char_plot_fire_history(out)
  # Individual figures can also be called directly:
  char_plot_sni(out)
  char_plot_fri(out)
  # Save all figures to PDF in a temporary directory:
  char_plot_all(out, save = TRUE, out_dir = tempdir())


CharAnalysis documentation built on May 3, 2026, 5:06 p.m.