plot_data {MixSIAR} | R Documentation |
Plot biotracer data
Description
plot_data
creates plot(s) of the biotracer data and saves the plot(s)
to file(s) in the working directory. All 3 required data files must have been
loaded by load_mix_data
, load_source_data
,
and load_discr_data
. Behavior depends on the number of tracers:
1 tracer: calls
plot_data_one_iso
to create a 1-D plot.2 tracers: calls
plot_data_two_iso
to create a biplot.>2 tracers: calls
plot_data_two_iso
in a loop to create biplots for each pairwise combination of biotracers.
Usage
plot_data(
filename,
plot_save_pdf,
plot_save_png,
mix,
source,
discr,
return_obj = FALSE
)
Arguments
filename |
name of the plot file(s) to save (e.g. "isospace_plot") |
plot_save_pdf |
T/F, save the plot(s) as a pdf? |
plot_save_png |
T/F, save the plot(s) as a png? |
mix |
output from |
source |
output from |
discr |
output from |
return_obj |
T/F, whether or not to return ggplot object for further modification, defaults to F |
Details
An important detail is that plot_data_two_iso
and plot_data_one_iso
plot the raw mix data and add the TDF to the source data, since this is
the polygon that the mixing model uses to determine proportions. The plotted
source means are:
\mu_source + \mu_discr
The source error bars are +/- 1 standard deviation, calculated as a combination of source and TDF variances:
\sqrt{\sigma^2_source + \sigma^2_discr}
plot_data
looks for 'C', 'N', 'S', and 'O' in the biotracer column
headers and assumes they are stable isotopes, labeling the axes with, e.g.,
expression(paste(delta^13, "C (u2030)",sep="")).
See Also
plot_data_two_iso
, plot_data_one_iso