From 6c02ce01fb6709528b53167ef6838bea218f3ae6 Mon Sep 17 00:00:00 2001 From: Niklas Hohmann <67792281+NiklasHohmann@users.noreply.github.com> Date: Fri, 4 Oct 2024 08:58:34 +0200 Subject: [PATCH 1/4] fix typo --- vignettes/paleoTS_functionality.Rmd | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/vignettes/paleoTS_functionality.Rmd b/vignettes/paleoTS_functionality.Rmd index 3e87bee..dc8e0c9 100644 --- a/vignettes/paleoTS_functionality.Rmd +++ b/vignettes/paleoTS_functionality.Rmd @@ -39,7 +39,7 @@ The `paleoTS` package defines its own `paleoTS` format to store time series. It 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`. +`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. ```{r fig.alt="plot of strict stasis"} library(StratPal) @@ -62,7 +62,7 @@ adm = tp_to_adm(t = scenarioA$t_myr, # define age-depth model 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 = 10) |> # simulate random walk on specimen level + 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 @@ -73,7 +73,7 @@ Of course you can also immediately add functions from `paleoTS` to the pipeline, ```{r} 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 = 10) |> # simulate random walk on specimen level + 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 From 4c72d82ca94d6024871847690aea303719657c5f Mon Sep 17 00:00:00 2001 From: Niklas Hohmann <67792281+NiklasHohmann@users.noreply.github.com> Date: Fri, 4 Oct 2024 13:05:14 +0200 Subject: [PATCH 2/4] fix typo --- R/ornstein_uhlenbeck_sl.R | 2 +- R/random_walk_sl.R | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/R/ornstein_uhlenbeck_sl.R b/R/ornstein_uhlenbeck_sl.R index f4b77e4..df46291 100644 --- a/R/ornstein_uhlenbeck_sl.R +++ b/R/ornstein_uhlenbeck_sl.R @@ -9,7 +9,7 @@ ornstein_uhlenbeck_sl = function(t, mu = 0, theta = 1, sigma = 1, y0 = 0, intrap #' @param theta number, mean reversion speed #' @param sigma positive number, strength of randomness #' @param y0 number, initial value (value of process at the first entry of t) - #' @param intrapop_var intrapopulation variance, determines how many specimens from the same population vary + #' @param intrapop_var intrapopulation variance, determines how much specimens from the same population vary #' @param n_per_sample integer, number of specimens sampled per population/sampling locality #' #' @description diff --git a/R/random_walk_sl.R b/R/random_walk_sl.R index f84985a..7aef718 100644 --- a/R/random_walk_sl.R +++ b/R/random_walk_sl.R @@ -7,7 +7,7 @@ random_walk_sl = function(t, sigma = 1, mu = 0, y0 = 0, intrapop_var = 1, n_per_ #' @param sigma positive number, variance parameter #' @param mu number, directionality parameter #' @param y0 number, starting value (value of the random walk at the first entry of `t`) - #' @param intrapop_var intrapopulation variance, determines how many specimens from the same population vary + #' @param intrapop_var intrapopulation variance, determines how mmuch specimens from the same population vary #' @param n_per_sample integer, number of specimens sampled per population/sampling locality #' #' @description From 96f7db1df27047aeda33835c14944b34661f2caf Mon Sep 17 00:00:00 2001 From: Niklas Hohmann <67792281+NiklasHohmann@users.noreply.github.com> Date: Mon, 14 Oct 2024 14:16:04 +0200 Subject: [PATCH 3/4] bugfix in apply niche and taphonomy, correct typos --- R/apply_niche.R | 2 +- R/apply_taphonomy.R | 2 +- R/random_walk_sl.R | 2 +- inst/WORDLIST | 5 ++++- man/ornstein_uhlenbeck_sl.Rd | 2 +- man/random_walk_sl.Rd | 2 +- vignettes/event_data.Rmd | 2 +- 7 files changed, 10 insertions(+), 7 deletions(-) diff --git a/R/apply_niche.R b/R/apply_niche.R index 1aca2e6..fa90842 100644 --- a/R/apply_niche.R +++ b/R/apply_niche.R @@ -81,7 +81,7 @@ apply_niche.pre_paleoTS = function(x, niche_def, gc){ thin_vals = change_in_niche(x$t) for (i in seq_along(thin_vals)){ r = prob_remove(x$vals[[i]], prob = thin_vals[i]) - x$vals[[i]] = x$vals[[i]][as.logical(r)] + x$vals[[i]] = r } return(x) } diff --git a/R/apply_taphonomy.R b/R/apply_taphonomy.R index e69394f..7fd881c 100644 --- a/R/apply_taphonomy.R +++ b/R/apply_taphonomy.R @@ -50,7 +50,7 @@ apply_taphonomy.pre_paleoTS = function(x, pres_potential, ctc){ } for (i in seq_along(thin_vals)){ r = prob_remove(x$vals[[i]], prob = thin_vals[i]) - x$vals[[i]] = x$vals[[i]][as.logical(r)] + x$vals[[i]] = r } return(x) } diff --git a/R/random_walk_sl.R b/R/random_walk_sl.R index 7aef718..cc71626 100644 --- a/R/random_walk_sl.R +++ b/R/random_walk_sl.R @@ -7,7 +7,7 @@ random_walk_sl = function(t, sigma = 1, mu = 0, y0 = 0, intrapop_var = 1, n_per_ #' @param sigma positive number, variance parameter #' @param mu number, directionality parameter #' @param y0 number, starting value (value of the random walk at the first entry of `t`) - #' @param intrapop_var intrapopulation variance, determines how mmuch specimens from the same population vary + #' @param intrapop_var intrapopulation variance, determines how much specimens from the same population vary #' @param n_per_sample integer, number of specimens sampled per population/sampling locality #' #' @description diff --git a/inst/WORDLIST b/inst/WORDLIST index 3329f37..9faf070 100644 --- a/inst/WORDLIST +++ b/inst/WORDLIST @@ -12,6 +12,7 @@ Jere Joël Koelewijn Lande +Lidgard Lipps MFSTFR Maruyama @@ -34,7 +35,6 @@ Taphonomy Uhlenbeck Zenodo al -approxfun artefactual automata cff @@ -54,6 +54,7 @@ heterodistant hohmann https interpopulation +intrapopulation io ith kyr @@ -65,6 +66,7 @@ ornstein paleoTS paleobiology paleontological +pnas pre sedimentological siliciclastic @@ -76,5 +78,6 @@ taphonomic taphonomy timelist uhlenbeck +un uu vectorized diff --git a/man/ornstein_uhlenbeck_sl.Rd b/man/ornstein_uhlenbeck_sl.Rd index c703d42..8b424c1 100644 --- a/man/ornstein_uhlenbeck_sl.Rd +++ b/man/ornstein_uhlenbeck_sl.Rd @@ -25,7 +25,7 @@ ornstein_uhlenbeck_sl( \item{y0}{number, initial value (value of process at the first entry of t)} -\item{intrapop_var}{intrapopulation variance, determines how many specimens from the same population vary} +\item{intrapop_var}{intrapopulation variance, determines how much specimens from the same population vary} \item{n_per_sample}{integer, number of specimens sampled per population/sampling locality} } diff --git a/man/random_walk_sl.Rd b/man/random_walk_sl.Rd index 8c1892c..128fdd9 100644 --- a/man/random_walk_sl.Rd +++ b/man/random_walk_sl.Rd @@ -22,7 +22,7 @@ random_walk_sl( \item{y0}{number, starting value (value of the random walk at the first entry of \code{t})} -\item{intrapop_var}{intrapopulation variance, determines how many specimens from the same population vary} +\item{intrapop_var}{intrapopulation variance, determines how much specimens from the same population vary} \item{n_per_sample}{integer, number of specimens sampled per population/sampling locality} } diff --git a/vignettes/event_data.Rmd b/vignettes/event_data.Rmd index 9814a4d..25de3b3 100644 --- a/vignettes/event_data.Rmd +++ b/vignettes/event_data.Rmd @@ -327,7 +327,7 @@ for details on how to expand on the modeling pipelines described here, or explor - Hohmann, Niklas; Koelewijn, Joël R.; Burgess, Peter; Jarochowska, Emilia. 2024. "Identification of the mode of evolution in incomplete carbonate successions." BMC Ecology and Evolution 24, 113. . -- Holland, Steven M. and Patzkowsky, Mark E. 1999. "Models for simulating the fossil record." Geology. [https://doi.org/10.1130/0091-7613(1999)027%3C0491:MFSTFR%3E2.3.CO;2](https://doi.org/10.1130/0091-7613(1999)027%3C0491:MFSTFR%3E2.3.CO;2){.uri} +- Holland, Steven M. and Patzkowsky, Mark E. 1999. "Models for simulating the fossil record." Geology. - Holland, Steven M. and Patzkowsky, Mark E. 2015. "The stratigraphy of mass extinction." Palaeontology. . From 5415ccf50ca75c84556c824cd94d2a166477a6ec Mon Sep 17 00:00:00 2001 From: Niklas Hohmann <67792281+NiklasHohmann@users.noreply.github.com> Date: Mon, 14 Oct 2024 14:16:55 +0200 Subject: [PATCH 4/4] Increment version number to 0.2.0.9001 --- DESCRIPTION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DESCRIPTION b/DESCRIPTION index e8ad661..df4a8d7 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: StratPal Title: Stratigraphic Paleobiology Modeling Pipelines -Version: 0.2.0.9000 +Version: 0.2.0.9001 Authors@R: person("Niklas", "Hohmann", , "N.H.Hohmann@uu.nl", role = c("aut", "cre"), comment = c(ORCID = "0000-0003-1559-1838"))