Learn R Programming

slendr (version 1.0.0)

ts_edges: Extract spatio-temporal edge annotation table from a given tree or tree sequence

Description

Extract spatio-temporal edge annotation table from a given tree or tree sequence

Usage

ts_edges(x)

Value

Data frame of the sf type containing the times of nodes and start-end coordinates of edges across space

Arguments

x

Tree object generated by ts_phylo or a slendr tree sequence object produced by ts_read, ts_recapitate, ts_simplify, or ts_mutate

Examples

Run this code
check_dependencies(python = TRUE, quit = TRUE) # dependencies must be present

init_env()

# load an example model with an already simulated tree sequence
slendr_ts <- system.file("extdata/models/introgression_slim.trees", package = "slendr")
model <- read_model(path = system.file("extdata/models/introgression", package = "slendr"))

# load the tree-sequence object from disk
ts <- ts_read(slendr_ts, model)

# extract an annotated table with (spatio-)temporal edge information
ts_edges(ts)

Run the code above in your browser using DataLab