arrange_regions {chronochrt}R Documentation

Arranging the regions (sections) of a chronological chart

Description

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

Usage

arrange_regions(data, order)

Arguments

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.

Value

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

Examples

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



[Package chronochrt version 0.1.3 Index]