ts_table | R Documentation |
This function extracts data from a given tree sequence table. All times are converted to model-specific time units from tskit's "generations backwards" time direction.
ts_table(ts, table = c("individuals", "edges", "nodes", "mutations"))
ts |
Tree sequence object of the class |
table |
Which tree sequence table to return |
For further processing and analyses, the output of the function
ts_nodes
might be more useful, as it merges the information in
node and individual tables into one table and further annotates it with
useful information from the model configuration data.
Data frame with the information from the give tree-sequence table (can be either a table of individuals, edges, nodes, or mutations).
ts_nodes
and ts_edges
for accessing an
annotated, more user-friendly and analysis-friendly tree-sequence table
data
# 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 and add mutations to it
ts <- ts_load(slendr_ts, model) %>% ts_mutate(mutation_rate = 1e-8, random_seed = 42)
# get the 'raw' tskit table of individuals
ts_table(ts, "individuals")
# get the 'raw' tskit table of edges
ts_table(ts, "edges")
# get the 'raw' tskit table of nodes
ts_table(ts, "nodes")
# get the 'raw' tskit table of mutations
ts_table(ts, "mutations")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.