View source: R/chronochrt_arrange_regions.R
arrange_regions | R Documentation |
This function ensures that the regions/sections of a chronological chart and of the accompanying labels are arranged in the desired order, not necessarily in an alphabetical one (the default plotting order).
arrange_regions(data, order)
data |
A data set with a column named "region". |
order |
A character vector with the desired order of the region/section titles. Each title must be given only once. |
A tibble with data ready-to-use for plotting with
plot_chronochrt
.
# Create example data set
chrons <- add_chron(region = c("A", "B"),
name = c("a", "a"),
start = -100,
end = c(200, 150),
level = c(1, 1),
add = FALSE,
new_table = TRUE)
# Arrange regions
chrons <- arrange_regions(data = chrons, order = c("B", "A"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.