convert_to_chron {chronochrt}R Documentation

Prepare an existing data set for plotting

Description

Convert an existing data set in a ready-to-plot data set.

Usage

convert_to_chron(data, region, name, start, end, level, add)

Arguments

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.

Details

Additional columns if the data set are directly passed to the output.

Value

A tibble with chronological data ready-to-use for plotting with plot_chronochrt.

Examples

# 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)

[Package chronochrt version 0.1.3 Index]