marginal_plot {ArchaeoPhases} | R Documentation |
Draws a plot of the marginal posterior density for a single parameter, with an option to add the mean and the credible interval at the desired level
marginal_plot(
data,
position = 1,
level = 0.95,
grid_length = 1024,
title = if (is.numeric(position)) names(data)[position] else position,
subtitle = "Marginal posterior density",
caption = paste(level * 100, "% credible interval", sep = ""),
x_label = "Calendar year",
y_label = "Density",
y_grid = TRUE,
x_scale = "calendar",
elapsed_origin_position = NULL,
x_min = NULL,
x_max = NULL,
height = 7,
width = 7,
units = "in",
file = NULL,
plot_result = TRUE,
mean_linetype = "dashed",
mean_color = "white",
mean_size = 0.5,
ci_linetype = "dotted",
ci_color = mean_color,
ci_size = mean_size,
line_linetype = "solid",
line_color = "black",
line_size = 1,
density_color = "gray30",
fill_palette = NULL
)
data |
Data frame containing the output of the MCMC algorithm. |
position |
Index of the column corresponding to the MCMC chain of interest, or a column name. |
level |
Probability corresponding to the level of confidence. |
grid_length |
Length of the grid used to estimate the density. |
title |
Title of the graph. The default uses the |
subtitle |
Subtitle of the graph. The default is "Marginal posterior density". |
caption |
Caption of the graph. The default describes the confidence of the credible interval. |
x_label |
Label of the x-axis. |
y_label |
Label of the y-axis. |
y_grid |
Switch for horizontal grid lines. |
x_scale |
One of "calendar" for calendar years, "BP" for years before present, or "elapsed" for time elapsed from a specified origin. |
elapsed_origin_position |
Position of the column to use as the origin for elapsed time calculations. |
x_min |
Minimum x axis value. |
x_max |
Maximum x axis value. |
height |
Plot height in |
width |
Plot width in |
units |
String recognized by the |
file |
Name of the file that will be saved if chosen,
default = |
plot_result |
If |
mean_linetype |
The |
mean_color |
The color of the line used to indicate mean density. |
mean_size |
The width of the line used to indicate the mean density. |
ci_linetype |
The |
ci_color |
The color of the lines used to indicate the credible intervals. |
ci_size |
The width of the lines used to indicate the credible intervals. |
line_linetype |
The |
line_color |
The color of the line used to indicate the density. |
line_size |
The width of the line used to indicate the density. |
density_color |
Color to use if fill_palette is not specified. |
fill_palette |
Palette to use for fills. |
The plot is drawn with the current theme and color scales; the function does not alter or override theme elements.
An archaeophases_plot
object with the data and metadata
needed to reproduce the plot.
Anne Philippe, Anne.Philippe@univ-nantes.fr;
Marie-Anne Vibet, Marie-Anne.Vibet@univ-nantes.fr; and
Thomas S. Dye, tsd@tsdye.online
data(Events)
mp <- marginal_plot(data = Events, position = 2, level = 0.95)
## View data and metadata
str(mp)