Skip to content

Commit

Permalink
Merge pull request #1 from MindTheGap-ERC/rev1
Browse files Browse the repository at this point in the history
Rev1
  • Loading branch information
NiklasHohmann authored Jan 16, 2025
2 parents 91be2cc + 8d7739d commit a3a42b6
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 4 deletions.
20 changes: 19 additions & 1 deletion code/examples.R
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ dev.off()
#### Figure 5 ####
# effect of water depth on fossil abundance
pdf(file = "figs/fig5.pdf")
par(mfrow = c(1,2))
par(mfrow = c(2,2))
gc = approxfun(scenarioA$t_myr, scenarioA$wd_m[,"12km"])
niche = snd_niche(opt = 100, tol = 30, cutoff_val = 0) # define niche with optimum at 100 m
plot(scenarioA$t_myr, gc(scenarioA$t_myr),
Expand All @@ -85,6 +85,24 @@ plot(scenarioA$t_myr, gc(scenarioA$t_myr),
ylab = "Water depth [m]",
main = "Water Depth on the Proximal Slope")

plot(x = scenarioA$t_myr,
y = niche(gc(scenarioA$t_myr)),
type = "l",
lwd = 3,
xlab = "Time [Myr]",
ylab = "Recovery probability",
main = "Niche in Time Domain")

r = list(t = scenarioA$t_myr, y = niche(gc(scenarioA$t_myr))) |> time_to_strat(adm12)

plot(x = r$h[!is.na(r$h)],
y = r$y[!is.na(r$h)],
type = "l",
lwd = 3,
xlab = "Stratigraphic position [m]",
ylab = "Recovery probability",
main = "Niche in Stratigraphic Domain")

p3(rate = rolo, min_time(adm12), max_time(adm12)) |>
apply_niche(niche, gc) |>
time_to_strat(adm12, destructive = TRUE) |>
Expand Down
6 changes: 3 additions & 3 deletions renv.lock
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@
},
"ape": {
"Package": "ape",
"Version": "5.8",
"Version": "5.8-1",
"Source": "Repository",
"Repository": "RSPM",
"Repository": "CRAN",
"Requirements": [
"R",
"Rcpp",
Expand All @@ -60,7 +60,7 @@
"stats",
"utils"
],
"Hash": "16b5ff4dff0ead9ea955f62f794b1535"
"Hash": "54e5b03e928da23e75dc5bb633648d27"
},
"codetools": {
"Package": "codetools",
Expand Down

0 comments on commit a3a42b6

Please sign in to comment.