read_lst | R Documentation |
Reads stratigraphic data in LST format (used by BASP Harris, Stratify, and ArchEd) into a data frame.
read_lst(file, split = TRUE, sep = ",", locale = readr::default_locale())
file |
Path to an LST file. |
split |
Controls how attributes that contain multiple values are
handled. If |
sep |
Delimiter used to separate multiple values in attributes.
multiple values. Ignored if |
locale |
|
This function supports both the original LST format used by BASP Harris and the "extended" format used by ArchEd and Stratify.
A data frame. Each row represents one stratum. Columns contain the name of the stratum and the attributes associated with it (typically "above", "contemporary_with", "equal_to" and "below").
Attribute names are standardised when read into column names. Specifically, they are transformed to lower case and spaces are replaced with an underscore (_).
Splitting multiple values into vectors is useful if the output is to be used
to construct a stratigraphic graph with stratigraph()
, but will convert
affected columns from atomic vectors to lists, which can make them awkward
to work with in other contexts. Set split = FALSE
to avoid this. You can
manually split them later with stringr::str_split()
.
http://archaeologic.al/wiki/Harris_Matrix#LST
# Example data from https://github.com/lparchaeology/harris2graph
# Simple LST (BASP Harris)
basp_lst <- system.file("extdata", "bonn.lst", package = "stratigraphr")
read_lst(basp_lst)
# Extended LST (Stratify, ArchEd)
stratify_lst <- system.file("extdata", "stratify.lst", package = "stratigraphr")
read_lst(stratify_lst)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.