Learn R Programming

tabs (version 0.2.0)

get_tsi: get_tsi

Description

get the time since isolation on a tabs object or recvect object

Usage

get_tsi(filename, extant = TRUE, recname = NULL, verbose = FALSE)

Value

list of dendrogram objects

Arguments

filename

path where files or qs2/rds was exported, reconstruct object of class tabs or recvect object

extant

boolean, only for currently existing shapes (TRUE) or all shapes (FALSE)

recname

recname, default NULL will create a tree for every merged polygon

verbose

boolean, print messages

Author

Johannes De Groeve

Examples

Run this code
if (FALSE) {
# load data samples
sporades <- sporades()
topo <- sporades$topo
labs <- sporades$labs
curve <- sporades$curve


# change duplicated names 
duplicates <- labs[labs$name == 'UNKNOWN',]$name
labs[labs$name == 'UNKNOWN',]$name <- paste0(duplicates,' ',toupper(letters[1:length(duplicates)]))

# reconstruct
rec <- reconstruct(topo=topo,
                   region=labs,
                   curve=curve,
                   reclabs='name'
                   )

# present day shapes only
tsi_e <- get_tsi(rec,
                 extant=TRUE
                 )
                      
# present and past shapes               
tsi_a <- get_tsi(rec,
                 extant=FALSE
                 )
         
# select specific shape for which the connectivity change is calculated
tsi <- get_tsi(rec,
               recname=rec$recvect$AP0000000$recname[6],
               extant=FALSE)
}

Run the code above in your browser using DataLab