knitr::opts_chunk$set( collapse = TRUE, comment = "#>" )
library(StratPal)
This vignette explain how to link the StratPal package with the paleoTS and evoTS packages (Hunt 2006, Voje 2023). For details on the underlying data structures, see vignette("StratPal_docs").
To combine the StratPal and the paleoTS/evoTS packages,
_sl (specimen level), optionally specifying the additional parameters for intrapopulation variance and number of specimensvignette("phenotypic_evolution"))paleoTS format using reduce_to_paleoTSpaleoTS or evoTS packageNote that simulation of multivariate phenotypic evolution as provided by the evoTS package is not yet implemented on specimen level. If you are interested in this functionality please contact the developer.
The paleoTS package allows to easily analyze paleontological time series, and StratPal can be connected to it to study how ecological, taphonomic, and stratigraphic effects change our inferences about the tempo and mode of evolution.
The paleoTS package defines its own paleoTS format to store time series. It is a summary format, as it combines trait values measured in multiple specimens into an intrapopulation variance. Because taphonomic and ecological effects act on individual specimens, they can not be modeled directly on the paleoTS format. To circumvent this problem, we introduce a pre_paleoTS format that models trait evolution on the specimen level. Stratigraphic, taphonomic, and ecological effects can act on this format. After all these effects have been applied, we can reduce this data format into the standard paleoTS format, and then analyze it with the standard toolbox of the paloeTS/evoTS packages.
Functions to model trait evolution on specimen level have the suffix _sl, standing for "specimen level". Internally, they are of S3 class pre_paleoTS. In addition to the options provided to simulate mean trait values, you can simulate strict stasis using strict_stasis_sl. All functions have the same parametrization as the as the other functions for simulating trait evolution, which simulate mean trait evolution. In addition, they take two additional parameters: intrapop_var for the variance of the population around the mean trait value, and n_per_sample for the number of specimens per sampling location.
pre_paleoTS results can be converted to the paleoTS format using the function reduce_to_paleoTS. After this you can plot them with the standard plotting procedure from paleoTS using plot (resp, plot.paleoTS). Note that you can not plot pre_paloeTS objects directly, only after conversion to paleoTS format.
library(StratPal) library(paleoTS) # needed for plotting strict_stasis_sl(t = 1:4) |> # simulate strict stasis on specimen level in `pre_paleoTS` format reduce_to_paleoTS() |> # convert pre_paleoTS to paleoTS plot() # plot
Modeling of niches, taphonomic effects, and stratigraphic biases works on pre_paleoTS objects identical to how it is described in the vignettes on event data and modeling phenotypic evolution. As example, we plot a random walk 2 km offshore with 5 specimens per sampling location:
library(admtools) # load admtools for stratigraphic transformation adm = tp_to_adm(t = scenarioA$t_myr, # define age-depth model h = scenarioA$h_m[,"2km"], L_unit = "m", T_unit = "Myr") set.seed(42) # set seed for reproducibility seq(min_time(adm), max_time(adm), by = 0.01) |> # sample every 0.01 Myr random_walk_sl(n_per_sample = 5) |> # simulate random walk on specimen level time_to_strat(adm) |> # transform into stratigraphic domain reduce_to_paleoTS() |> # transform into paleoTS format plot() # plot
Of course you can also immediately add functions from paleoTS to the pipeline, e.g. to fit models of phenotypic evolution from the simulated data:
set.seed(42) # set seed for reproducibility seq(min_time(adm), max_time(adm), by = 0.01) |> # sample every 0.01 Myr random_walk_sl(n_per_sample = 5) |> # simulate random walk on specimen level time_to_strat(adm) |> # transform into stratigraphic domain reduce_to_paleoTS() |> # transform into paleoTS format fit3models() # fit 3 models to time series
Hunt, Gene. 2006. “Fitting and Comparing Models of Phyletic Evolution: Random Walks and Beyond.” Paleobiology. https://doi.org/10.1666/05070.1.
Voje, Kjetil L. 2023. “Fitting and Evaluating Univariate and Multivariate Models of Within-Lineage Evolution.” Paleobiology. https://doi.org/10.1017/pab.2023.10.
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.