View source: R/MultiMarginalPlot.R

multi_marginal_plot | R Documentation |

Draws a plot of the estimated marginal posterior density for a parameter and adds the mean and the credible interval at the desired level

multi_marginal_plot( data, position = 1:ncol(data), level = 0.95, grid_length = 1024, x_scale = "calendar", elapsed_origin_position = NULL, title = "Characteristics of several dates", subtitle = "Marginal densities", caption = paste(level * 100, "% credible interval", sep = ""), x_label = "Calendar year", y_label = NULL, density_fill = "gray30", density_color = "black", density_alpha = 1, mean_color = "white", mean_linetype = "dashed", mean_size = 0.5, ci_color = mean_color, ci_linetype = "dotted", ci_size = mean_size, y_grid = TRUE, x_min = NULL, x_max = NULL, height = 7, width = 7, units = "in", file = NULL, new_window = TRUE, plot_result = TRUE, fill_palette = NULL, colors = NULL, color_legend_name = "Legend" )

`data` |
Data frame containing the output of the MCMC algorithm. |

`position` |
Numeric vector containing the position of the column corresponding to the MCMC chains of interest, or a vector of column names. |

`level` |
Probability corresponding to the level of confidence. |

`grid_length` |
Number of equally spaced points at which the
density is to be estimated (for |

`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. |

`title` |
Title of the plot. |

`subtitle` |
Subtitle of the plot. |

`caption` |
Caption of the plot. |

`x_label` |
Label of the x-axis. |

`y_label` |
Label of the y-axis. |

`density_fill` |
A color specification for the fill under the density line. |

`density_color` |
A color specification for the density line. |

`density_alpha` |
A number between 0 for transparent and 1 for opaque. |

`mean_color` |
A color specification for the mean line. |

`mean_linetype` |
A line type specification for the mean line. |

`mean_size` |
A size specification for the mean line. |

`ci_color` |
A color specification for the credible interval lines. |

`ci_linetype` |
A line type specification for the credible interval lines. |

`ci_size` |
A size specification of the credible interval lines. |

`y_grid` |
Switch for horizontal grid lines. |

`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 specified,
default = |

`new_window` |
Whether or not the plot is drawn within a new window. |

`plot_result` |
If |

`fill_palette` |
A vector of colors for qualitative data. |

`colors` |
A vector of indices into palette keyed by position. |

`color_legend_name` |
A label for the legend. |

The density is estimated using `density()`

function with
n = `grid_length.`

The input MCMC chains should either be in
calendar years or converted to calendar years using `x_scale`

vector or
`elapsed_origin_position`

.

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); multi_marginal_plot(Events, position = c(2, 3, 4), level = 0.95)

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.