plot_summary: Plot summary functions

View source: R/rTEM_summarize.R

plot_summaryR Documentation

Plot summary functions

Description

Plot the observed value with envelopes for expected values for summary function

Usage

plot_summary(
  func = "K",
  observed_values,
  envelopes,
  ...,
  pattern.colors = c(`Envelope 1` = "pink", `Envelope 2` = "gray", Observed = "blue"),
  fill.colors = NA,
  sqrt = "K",
  raw = "FALSE",
  base_value = "first",
  unit = "nm",
  K_cor = "trans",
  G_cor = "km",
  F_cor = "km",
  GXGH_cor = "km",
  GXHG_cor = "km",
  G2_cor = "km",
  alpha = 0.5,
  legend.key.size = 20,
  legend.text.size = 20,
  legend.position = c(0.75, 0.8),
  axis.title.size = 40,
  title = "",
  title.size = 40,
  axis.text.x.size = 40,
  axis.text.y.size = 40,
  linewidth = 0.5,
  env_linewidth = 0.5,
  linetype = "solid",
  env_linetype = "dashed"
)

Arguments

func

Summary function to plot.

observed_values

a list. observed summary function value. Must have one of the following structures

  • Option 1: List of summary functionsobserved_values[[func]][[cor]]

  • Option 2: List of lists of summary functionsobserved_values[[pattern_num]][[func]][[cor]]

  • Option 2: Dataframeobserved_values[,c("r", y_value)]

envelopes

a list envelope values found by function such as calc_summary_funcs. Should be list of length equal to the number of envelopes. The structure should resemble: 'envelopes[[envelope_num]]$rrl_K[, c("r", "mmean")]'

pattern.colors

colors and names for envelope lines. MUST follow some formatting rules. Envelope names must come first. If each observed value corresponds to a different envelope, then the number of 'observed_values' must match 'length(envelopes)' and only the first '1:length(envelopes)' of 'pattern_colors' will be used. and must set 'base_value = "each"'. If not, each envelope and each observed value needs its own color. then the 'mmean' value from 'envelopes[[1]]' will be subtracted from each envelope and observed value.

fill.colors

colors and names for envelope fill. Match names to 'pattern.colors'. Recommended to leave as NA and it will automattically be set to match 'pattern.colors'

sqrt

either '"K", "all", or "none"'. If '"K"', then only expression(tilde(K)[g](r)) will be found using the differences of the square roots, rather than differences. If '"all"', then all functions will be found using such. If '"none"' (or actually anything other than the first two options) then no square roots are taken. Ignored if 'raw = "TRUE"'

base_value

a character, either '"first" or "each"'. Does each observed value correspond to a different envelope? If yes, set to '"each"'. Otherwise, set to '"first"' and the envelopes[[1]] will be used for each

unit

a character. This will appear as the units in the x axis label

K_cor

edge correction(s) to be used when 'func = "K"'

G_cor

edge correction(s) to be used when 'func = "G"'

F_cor

edge correction(s) to be used when 'func = "F"'

GXGH_cor

edge correction(s) to be used when 'func = "GXGH"'

GXHG_cor

edge correction(s) to be used when 'func = "GXHG"'

alpha

numeric between 0 and 1. Transparency of envelopes

legend.key.size

numeric. size of legend key

legend.text.size

numeric. size of legend text

axis.title.size

numeric. Size of axis title

title

a character. Text for title

title.size

numeric. Title size

axis.text.x.size

numeric. size of text on x axis

axis.text.y.size

numeric. size of text on y axis

linewidth

numeric. Width of lines in plot

env_linewidth

numeric. Width of lines that make up envelope edges

linetype

a character. Type of lines that make up lines

env_linetype

a character. Type of lines that make up envelope lines

raw.

A logical. If TRUE, then no envelope mmeans are subtracted from each value

legend.position.

vector of 2 numerics. coordinates of legend

Details

The best way to learn about this function is to read the parameter definitions.


rolandrolandroland/rTEM documentation built on March 29, 2025, 2:17 p.m.