deeptime

An R package that facilitates highly customizable and reproducible visualizations of data over geological time intervals

https://github.com/willgearty/deeptime

Science Score: 49.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
    Found 3 DOI reference(s) in README
  • Academic publication links
    Links to: zenodo.org
  • Committers with academic emails
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (16.7%) to scientific vocabulary

Keywords

geology ggplot2 paleontology r visualization
Last synced: 6 months ago · JSON representation

Repository

An R package that facilitates highly customizable and reproducible visualizations of data over geological time intervals

Basic Info
Statistics
  • Stars: 100
  • Watchers: 4
  • Forks: 11
  • Open Issues: 13
  • Releases: 19
Topics
geology ggplot2 paleontology r visualization
Created over 7 years ago · Last pushed 6 months ago
Metadata Files
Readme Changelog License Zenodo

README.md

deeptime

R-CMD-check codecov DOI CRAN status CRAN downloads <!-- badges: end -->

Overview

deeptime extends the functionality of other plotting packages (notably {ggplot2}) to help facilitate the plotting of data over long time intervals, including, but not limited to, geological, evolutionary, and ecological data. The primary goal of deeptime is to enable users to add highly customizable timescales to their visualizations. Other functions are also included to assist with other areas of deep time visualization.

Installation

```r

get the stable version from CRAN

install.packages("deeptime")

or get the development version from github

install.packages("devtools")

devtools::install_github("willgearty/deeptime") ```

Usage

Load packages

r library(deeptime) library(ggplot2) library(dplyr)

Add one or more timescales to virtually any ggplot2 plot!

The main function of deeptime is coord_geo(), which functions just like coord_trans() from {ggplot2}. You can use this function to add highly customizable timescales to a wide variety of ggplots.

```r library(divDyn) data(corals)

this is not a proper diversity curve but it gets the point across

coraldiv <- corals %>% filter(stage != "") %>% groupby(stage) %>% summarise(n = n()) %>% mutate(stageage = (stages$maxage[match(stage, stages$name)] + stages$minage[match(stage, stages$name)])/2) ggplot(coraldiv) + geomline(aes(x = stageage, y = n)) + scalexreverse("Age (Ma)") + ylab("Coral Genera") + coordgeo(xlim = c(250, 0), ylim = c(0, 1700)) + themeclassic(base_size = 16) ```

Lots of timescales available!

```r

Load packages

library(gsloid)

Plot two different timescales

ggplot(lisiecki2005) + geomline(aes(x = d18O, y = Time / 1000), orientation = "y") + scaleyreverse("Time (Ma)") + scalexreverse("\u03B418O") + coordgeo( dat = list("Geomagnetic Polarity Chron", "Planktic foraminiferal Primary Biozones"), xlim = c(6, 2), ylim = c(5.5, 0), pos = list("l", "r"), rot = 90, skip = "PL4", size = list(5, 4) ) + themeclassic(basesize = 16) ```

Super flexible, supports multiple layouts, and works great with other packages!

```r

Load packages

library(ggtree) library(rphylopic)

Get vertebrate phylogeny

library(phytools) data(vertebrate.tree)

vertebrate.tree$tip.label[vertebrate.tree$tip.label == "Myotislucifugus"] <- "Vespertilioninae" vertebratedata <- data.frame(species = vertebrate.tree$tip.label, name = vertebrate.tree$tip.label)

Plot the phylogeny with a timescale

revts(ggtree(vertebrate.tree, size = 1)) %<+% vertebratedata + geomphylopic(aes(name = name), size = 25) + scalexcontinuous("Time (Ma)", breaks = seq(-500, 0, 100), labels = seq(500, 0, -100), limits = c(-500, 0), expand = expansion(mult = 0)) + scaleycontinuous(guide = NULL) + coordgeoradial(dat = "periods", end = 0.5 * pi) + themeclassic(basesize = 16) ```

Does lots of other things too!

Plot fossil occurence ranges

```r library(palaeoverse)

Filter occurrences

occdf <- subset(tetrapods, acceptedrank == "genus") occdf <- subset(occdf, acceptedname %in% c("Eryops", "Dimetrodon", "Diadectes", "Diictodon", "Ophiacodon", "Diplocaulus", "Benthosuchus"))

Plot occurrences

ggplot(data = occdf) + geompointsrange(aes(x = (maxma + minma)/2, y = acceptedname)) + scalexreverse(name = "Time (Ma)") + ylab(NULL) + coordgeo(pos = list("bottom", "bottom"), dat = list("stages", "periods"), abbrv = list(TRUE, FALSE), expand = TRUE, size = "auto") + themeclassic(basesize = 16) ```

Use standardized geological patterns

```r

Load packages

library(rmacrostrat) library(ggrepel)

Retrieve the Macrostrat units in the San Juan Basin column

sanjuanunits <- getunits(columnid = 489, interval_name = "Cretaceous")

Specify xmin and xmax in dataframe

sanjuanunits$xmin <- 0 sanjuanunits$xmax <- 1

Tweak values for overlapping units

sanjuanunits$xmax[10] <- 0.5 sanjuanunits$xmin[11] <- 0.5

Add midpoint age for plotting

sanjuanunits$mage <- (sanjuanunits$bage + sanjuanunits$t_age) / 2

Get lithology definitions

liths <- def_lithologies()

Get the primary lithology for each unit

sanjuanunits$lithprim <- sapply(sanjuan_units$lith, function(df) { df$name[which.max(df$prop)] })

Get the pattern codes for those lithologies

sanjuanunits$pattern <- factor(liths$fill[match(sanjuanunits$lith_prim, liths$name)])

Plot with pattern fills

ggplot(sanjuanunits, aes(ymin = bage, ymax = tage, xmin = xmin, xmax = xmax)) + # Plot units, patterned by rock type geomrect(aes(fill = pattern), color = "black") + scalefillgeopattern(name = NULL, breaks = factor(liths$fill), labels = liths$name) + # Add text labels geomtextrepel(aes(x = xmax, y = mage, label = unitname), size = 3.5, hjust = 0, force = 2, min.segment.length = 0, direction = "y", nudgex = replen(x = c(2, 3), length.out = 17)) + # Add geological time scale coordgeo(pos = "left", dat = list("stages"), rot = 90) + # Reverse direction of y-axis scaleyreverse(limits = c(145, 66), n.breaks = 10, name = "Time (Ma)") + # Remove x-axis guide and title scalexcontinuous(NULL, guide = NULL) + # Choose theme and font size themeclassic(basesize = 14) + # Make tick labels black theme(legend.position = "bottom", legend.key.size = unit(1, 'cm'), axis.text.y = elementtext(color = "black")) ```

Citation

If you use the deeptime R package in your work, please cite as:

Gearty, W. 2025. deeptime: an R package that facilitates highly customizable and reproducible visualizations of data over geological time intervals. Big Earth Data. doi: 10.1080/20964471.2025.2537516.

Owner

  • Name: William Gearty
  • Login: willgearty
  • Kind: user
  • Location: New York, NY
  • Company: American Museum of Natural History

Postdoctoral Research Fellow paleobiology, macroevolution, and macroecology

GitHub Events

Total
  • Create event: 3
  • Release event: 2
  • Issues event: 23
  • Watch event: 20
  • Delete event: 1
  • Issue comment event: 21
  • Push event: 67
  • Pull request event: 3
  • Pull request review event: 1
  • Pull request review comment event: 1
  • Fork event: 2
Last Year
  • Create event: 3
  • Release event: 2
  • Issues event: 23
  • Watch event: 20
  • Delete event: 1
  • Issue comment event: 21
  • Push event: 67
  • Pull request event: 3
  • Pull request review event: 1
  • Pull request review comment event: 1
  • Fork event: 2

Committers

Last synced: 9 months ago

All Time
  • Total Commits: 416
  • Total Committers: 4
  • Avg Commits per committer: 104.0
  • Development Distribution Score (DDS): 0.007
Past Year
  • Commits: 103
  • Committers: 1
  • Avg Commits per committer: 103.0
  • Development Distribution Score (DDS): 0.0
Top Committers
Name Email Commits
William Gearty w****y@g****m 413
Karlo Guidoni Martins k****s@g****m 1
Guangchuang Yu g****u@g****m 1
AEgit A****t 1

Issues and Pull Requests

Last synced: 6 months ago

All Time
  • Total issues: 81
  • Total pull requests: 9
  • Average time to close issues: 3 months
  • Average time to close pull requests: 18 days
  • Total issue authors: 16
  • Total pull request authors: 7
  • Average comments per issue: 1.74
  • Average comments per pull request: 1.67
  • Merged pull requests: 5
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 19
  • Pull requests: 5
  • Average time to close issues: 3 months
  • Average time to close pull requests: 3 days
  • Issue authors: 3
  • Pull request authors: 3
  • Average comments per issue: 0.37
  • Average comments per pull request: 1.2
  • Merged pull requests: 2
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • willgearty (58)
  • mcranium (4)
  • LewisAJones (3)
  • joelnitta (2)
  • jackolivershaw (1)
  • markscherz (1)
  • almeidasilvaf (1)
  • StromTroopers (1)
  • tiago-simoes (1)
  • bethany-j-allen (1)
  • tania-k (1)
  • GuangchuangYu (1)
  • RashBabiker (1)
  • thomasp85 (1)
  • alexskeels (1)
Pull Request Authors
  • willgearty (2)
  • richardstockey (2)
  • teunbrand (2)
  • almeidasilvaf (2)
  • GuangchuangYu (1)
  • kguidonimartins (1)
  • AEgit (1)
Top Labels
Issue Labels
enhancement (32) bug (17) dependency (5) wontfix (2) question (1) help wanted (1)
Pull Request Labels
dependency (2)

Packages

  • Total packages: 2
  • Total downloads:
    • cran 755 last-month
  • Total docker downloads: 21,613
  • Total dependent packages: 4
    (may contain duplicates)
  • Total dependent repositories: 5
    (may contain duplicates)
  • Total versions: 32
  • Total maintainers: 1
proxy.golang.org: github.com/willgearty/deeptime
  • Versions: 19
  • Dependent Packages: 0
  • Dependent Repositories: 0
Rankings
Dependent packages count: 6.5%
Average: 6.7%
Dependent repos count: 6.9%
Last synced: 6 months ago
cran.r-project.org: deeptime

Plotting Tools for Anyone Working in Deep Time

  • Versions: 13
  • Dependent Packages: 4
  • Dependent Repositories: 5
  • Downloads: 755 Last month
  • Docker Downloads: 21,613
Rankings
Stargazers count: 5.1%
Forks count: 8.8%
Dependent packages count: 10.6%
Average: 10.8%
Dependent repos count: 13.2%
Downloads: 16.5%
Maintainers (1)
Last synced: 6 months ago

Dependencies

DESCRIPTION cran
  • R >= 3.4 depends
  • curl * imports
  • ggfittext * imports
  • ggforce * imports
  • ggnewscale * imports
  • ggplot2 * imports
  • grid * imports
  • gridExtra * imports
  • gtable * imports
  • lattice * imports
  • methods * imports
  • rlang * imports
  • scales * imports
  • stats * imports
  • utils * imports
  • dispRity * suggests
  • divDyn * suggests
  • ggtree * suggests
  • gsloid * suggests
  • paleotree * suggests
  • phytools * suggests
  • testthat >= 3.0.0 suggests
  • tidyverse * suggests
  • vdiffr >= 1.0.0 suggests
.github/workflows/R-CMD-check.yaml actions
  • actions/checkout v3 composite
  • r-lib/actions/check-r-package v2 composite
  • r-lib/actions/setup-pandoc v2 composite
  • r-lib/actions/setup-r v2 composite
  • r-lib/actions/setup-r-dependencies v2 composite
.github/workflows/lint.yaml actions
  • actions/checkout v3 composite
  • r-lib/actions/setup-r v2 composite
  • r-lib/actions/setup-r-dependencies v2 composite
.github/workflows/pkgdown.yaml actions
  • JamesIves/github-pages-deploy-action v4.4.1 composite
  • actions/checkout v3 composite
  • r-lib/actions/setup-pandoc v2 composite
  • r-lib/actions/setup-r v2 composite
  • r-lib/actions/setup-r-dependencies v2 composite
.github/workflows/revdepcheck.yml actions
  • actions/cache v2 composite
  • actions/checkout v3 composite
  • actions/upload-artifact main composite
  • r-lib/actions/setup-pandoc v2 composite
  • r-lib/actions/setup-r v2 composite
.github/workflows/test-coverage.yaml actions
  • actions/checkout v3 composite
  • actions/upload-artifact v3 composite
  • r-lib/actions/setup-r v2 composite
  • r-lib/actions/setup-r-dependencies v2 composite