traceplot | R Documentation |
Wrapper around plot
to make a traceplot of Gibbs samples from gibbs_ad
. See histogram
for plotting a density histogram of events.
traceplot(
x,
events = NULL,
xlim = NULL,
ylim = NULL,
xlab = "Index",
ylab = "Year",
palette = NULL,
opacity = 1,
legend_pos = "topright",
...
)
## S3 method for class 'marginals'
traceplot(
x,
events = NULL,
xlim = NULL,
ylim = NULL,
xlab = "Index",
ylab = "Year",
palette = NULL,
opacity = 1,
legend_pos = "topright",
...
)
x |
A |
events |
A vector or element of the event names to plot. Maximum number of events is 12. |
xlim |
The limits of the x-axis (optional). |
ylim |
The limits of the y-axis (optional). |
xlab |
Label for the y-axis. Default is |
ylab |
Label for the y-axis. Default is |
palette |
A vector providing the color palette of the histogram. The default is |
opacity |
The opacity/transparency of the traceplot, if visualizing overlapping events. A value between 0 and 1 (default). |
legend_pos |
The position of the legend in the plot. Default is |
... |
Additional graphical parameters passed to |
Also see tidy_marginals
for exporting the results of these functions into tidy data frame for custom plotting in e.g., ggplot2
.
A traceplot of the Gibbs samples of the selected events.
x <- c("A", "B", "C", "D", "E", "F", "G", "H", "I", "J")
y <- c("B", "D", "G", "H", "K")
z <- c("F", "K", "L", "M")
contexts <- list(x, y, z)
f1 <- list(id = "find01", assoc = "D", type = c("type1", "form1"))
f2 <- list(id = "find02", assoc = "E", type = c("type1", "form2"))
f3 <- list(id = "find03", assoc = "G", type = c("type1", "form1"))
f4 <- list(id = "find04", assoc = "H", type = c("type2", "form1"))
f5 <- list(id = "find05", assoc = "I", type = "type2")
f6 <- list(id = "find06", assoc = "H", type = NULL)
artifacts <- list(f1, f2, f3, f4, f5, f6)
# external constraints
coin1 <- list(id = "coin1", assoc = "B", type = NULL, samples = runif(100,-320,-300))
coin2 <- list(id = "coin2", assoc = "G", type = NULL, samples = seq(37, 41, length = 100))
destr <- list(id = "destr", assoc = "J", type = NULL, samples = 79)
tpq_info <- list(coin1, coin2)
taq_info <- list(destr)
result <- gibbs_ad(contexts, finds = artifacts, tpq = tpq_info, taq = taq_info)
traceplot(result, "B")
traceplot(result, c("coin1", "B", "H"), opacity = 0.5)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.