ts_save: Save a tree sequence to a file

View source: R/tree-sequences.R

ts_saveR Documentation

Save a tree sequence to a file

Description

Save a tree sequence to a file

Usage

ts_save(ts, file)

Arguments

ts

Tree sequence object loaded by ts_load

file

File to which the tree sequence should be saved

Value

No return value, called for side effects

Examples


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
ts <- ts_load(slendr_ts, model)

# save the tree-sequence object to a different location
another_file <- paste(tempfile(), ".trees")
ts_save(ts, another_file)

slendr documentation built on June 22, 2024, 6:56 p.m.