View source: R/chronochrt_convert_to_chron.R
convert_to_chron | R Documentation |
Convert an existing data set in a ready-to-plot data set.
convert_to_chron(data, region, name, start, end, level, add)
data |
A data frame or tibble |
region |
The column name of the regions/sections in the plot. |
name |
The column name of the names of the chronological units. Must be a character string. |
start |
The column name of the start dates of the chronological units. |
end |
The column name of the end date of the chronological units. |
level |
The column name of the level of the chronological unit. |
add |
The column name of the columns which signals whether the chronological units within a geographical area should be drawn separately. |
Additional columns if the data set are directly passed to the output.
A tibble with chronological data ready-to-use for plotting with
plot_chronochrt
.
# Create example data set
data <- data.frame(Location = c("A", "B"),
Dynasty = c("a", "a"),
Begin = -100,
End = c(200, 150),
Subunit = 1,
Parallel = FALSE)
# Convert to chronological data set
chrons <- convert_to_chron(data = data,
region = Location,
name = Dynasty,
start = Begin,
end = End,
level = Subunit,
add = Parallel)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.