# 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_read(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")
# get the 'raw' tskit table of sites
ts_table(ts, "sites")
Run the code above in your browser using DataLab