histogram | R Documentation |
Wrapper around hist
to plot density histograms for select marginal densities (up to 12) in a single plot, from the results of gibbs_ad
, or to plot density histograms of the production, deposition, and use of a type, from the results of gibbs_ad_use]
.
histogram(
x,
events = NULL,
aspect = c("production", "use", "deposition"),
display_name = "Type",
breaks = "Freedman-Diaconis",
xlim = NULL,
ylim = NULL,
xlab = "Year",
palette = NULL,
opacity = 1,
legend_pos = "topright"
)
## S3 method for class 'marginals'
histogram(
x,
events = NULL,
aspect = NULL,
display_name = NULL,
breaks = "Freedman-Diaconis",
xlim = NULL,
ylim = NULL,
xlab = "Year",
palette = NULL,
opacity = 1,
legend_pos = "topright"
)
## S3 method for class 'use_marginals'
histogram(
x,
events = NULL,
aspect = c("production", "use", "deposition"),
display_name = "Type",
breaks = "Freedman-Diaconis",
xlim = NULL,
ylim = NULL,
xlab = "Year",
palette = NULL,
opacity = 0.5,
legend_pos = "topright"
)
x |
A |
events |
If plotting a |
aspect |
If plotting a |
display_name |
If plotting a |
breaks |
The number or method of breaks in the histogram. Default is |
xlim |
The limits of the x-axis. Default is set to the min/max values of all samples. |
ylim |
The limits of the y-axis. This may need to be adjusted if densities have an extremely narrow interval. |
xlab |
Label for the x-axis. Default is |
palette |
A vector providing the color palette of the histogram. The default is |
opacity |
The opacity/transparency of the histograms for visualizing overlapping events, a value between 0 and 1 (default). |
legend_pos |
The position of the legend in the plot. Default is |
Also see also tidy_marginals
for exporting the results of these functions into tidy data frame for custom plotting in e.g., ggplot2
.
A density histogram of the selected events/aspects.
A density histogram of the selected events/aspect.
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)
# deposition of "B"
histogram(result, "B")
# deposition of "coin2" and deposition of "G"
histogram(result, c("coin2", "G"), opacity = 0.5)
# production of "type2" and deposition of "H"
histogram(result, c("H", "type2"), opacity = 0.5)
# production, use, and deposition of "type1"
type1_use <- gibbs_ad_use(result, artifacts, type = "type1",
max_samples = 1000, size = 500, mcse_crit = 2)
histogram(type1_use)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.