{"id":26897686,"url":"https://github.com/brpetrucci/paleobuddy","last_synced_at":"2025-05-13T00:04:40.418Z","repository":{"id":38043522,"uuid":"276197267","full_name":"brpetrucci/paleobuddy","owner":"brpetrucci","description":"paleobuddy: an R package for simulating diversification dynamics, fossil records and phylogenies in R.","archived":false,"fork":false,"pushed_at":"2025-03-03T18:17:41.000Z","size":58784,"stargazers_count":6,"open_issues_count":1,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-05-13T00:04:31.859Z","etag":null,"topics":["evolution","macroevolution","package","paleobiology","paleontology","phylogenetics","r"],"latest_commit_sha":null,"homepage":"","language":"R","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/brpetrucci.png","metadata":{"files":{"readme":"README.Rmd","changelog":"NEWS.md","contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-06-30T20:04:32.000Z","updated_at":"2025-02-27T17:17:48.000Z","dependencies_parsed_at":"2022-07-12T10:22:28.088Z","dependency_job_id":"c521b027-ae16-4cb0-8248-e8ffeb7d0aaa","html_url":"https://github.com/brpetrucci/paleobuddy","commit_stats":{"total_commits":279,"total_committers":5,"mean_commits":55.8,"dds":0.4946236559139785,"last_synced_commit":"c39f39abbc45d3231dd862f37b30eb0270bc1e5b"},"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brpetrucci%2Fpaleobuddy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brpetrucci%2Fpaleobuddy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brpetrucci%2Fpaleobuddy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brpetrucci%2Fpaleobuddy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/brpetrucci","download_url":"https://codeload.github.com/brpetrucci/paleobuddy/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253843211,"owners_count":21972873,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["evolution","macroevolution","package","paleobiology","paleontology","phylogenetics","r"],"created_at":"2025-04-01T04:58:48.449Z","updated_at":"2025-05-13T00:04:40.379Z","avatar_url":"https://github.com/brpetrucci.png","language":"R","funding_links":[],"categories":["Software \u0026 Analysis Tools"],"sub_categories":[],"readme":"---\noutput: github_document\n---\n\n\u003c!-- README.md is generated from README.Rmd. Please edit that file --\u003e\n\n```{r, include=FALSE}\nknitr::opts_chunk$set(\n  collapse = TRUE,\n  comment = \"#\u003e\",\n  fig.path = \"man/figures/README-\",\n  out.width = \"100%\"\n)\n```\n\n# paleobuddy\n\n\u003c!-- badges: start --\u003e\n[![R-CMD-check](https://github.com/brpetrucci/paleobuddy/workflows/R-CMD-check/badge.svg)](https://github.com/brpetrucci/paleobuddy/actions/workflows/R-CMD-check.yaml)\n[![CRAN_Status_Badge](https://www.r-pkg.org/badges/version/paleobuddy)](https://cran.r-project.org/package=paleobuddy)\n\u003c!-- badges: end --\u003e\n\n`paleobuddy` is an R package to simulate species diversification, fossil records, and phylogenetic trees. While the literature on species birth-death simulators is extensive, including important software like [paleotree](https://github.com/dwbapst/paleotree) and [APE](https://github.com/cran/ape), we concluded there were interesting gaps to be filled regarding possible diversification scenarios. Differently from most simulators in the field, we strove for flexibility over focus, implementing a large array of regimens for users to experiment with and combine, and structuring the package on a general framework to allow for straightforward expansion of available scenarios. In this way, `paleobuddy` can be used as a complement to other simulators or, in the case of scenarios implemented only here, can allow for robust and easy simulations for novel scenarios.\n\n## Installation\n\nYou can install the released version of paleobuddy from [CRAN](https://CRAN.R-project.org) with:\n\n```{r eval=FALSE}\ninstall.packages(\"paleobuddy\")\n```\n\nAnd the development version from [GitHub](https://github.com/) with:\n\n```{r eval=FALSE}\nlibrary(devtools)\ndevtools::install_github(\"brpetrucci/paleobuddy\")\n```\n\n```{r include=FALSE}\nlibrary(paleobuddy)\n```\n\n## Example\n\nWe run a simple birth-death simulation as follows\n\n```{r}\nset.seed(1)\n\nn0 \u003c- 1 # initial number of species\nlambda \u003c- 0.1 # speciation rate\nmu \u003c- 0.05 # extinction rate\ntMax \u003c- 30 # maximum simulation time\n\n# run simulation\nsim \u003c- bd.sim(n0, lambda, mu, tMax)\n```\n\nWe can then generate fossil records, and visualize the results\n\n```{r message=FALSE, out.width=\"50%\"}\nset.seed(1)\n\nrho \u003c- 1 # sampling rate\nbins \u003c- seq(tMax, 0, -1) # something to simulate geologic intervals\n\n# get a data frame with fossil occurrence times\nfossils \u003c- sample.clade(sim = sim, rho = rho, tMax = tMax, bins = bins)\n\n# visualize simulation and fossil occurrences\ndraw.sim(sim, fossils = fossils)\n```\n\nAnd generate phylogenies as well\n\n```{r out.width=\"50%\"}\nphy \u003c- make.phylo(sim) # make a phylogenetic tree with the simulated group\nape::plot.phylo(phy, root.edge = TRUE) # plot it with a stem (requires APE)\nape::axisPhylo() # add axis\n```\n\n## Important functions\n\n`bd.sim` is the birth-death simulation function, allowing for multiple arguments to build a large number of possible scenarios. One can supply constant or time-dependent speciation rate `lambda` and extinction rate `mu`. On top of the base rates, we allow for a `shape` parameter for each, if one chooses to interpret `lambda` and `mu` as scales of a Weibull distribution for age-dependent diversification. We take the novel step allowing for time-dependent scale and shape as well. One can also supply an `env` parameter to make rates dependent on a time-series, such as temperature. These can all be combined as the user wishes, creating a myriad of possible scenarios.\n\n`sample.clade` generates fossil records, returning an organized data frame with occurrence times - or occurrence time ranges, provided the user supplies the respective interval vector. It allows for a sampling rate `rho` that can be as flexible as `lambda` and `mu` above, with the exception of a `shape` parameter, since we omitted that option given the absence of the use of Weibull distributions to model age-dependent fossil sampling in the literature. Instead, we allow for the user to supply a function they wish to use as age-dependent sampling, `adFun`, such as the PERT distribution used in [PyRate](https://github.com/dsilvestro/PyRate).\n\n`bd.sim.traits` and `sample.clade.traits` work similarly to `bd.sim` and `sample.clade`, but on the context of state-dependent diversification, in particular using the MuSSE model. \n\n`make.phylo` closes the trio of most important functions of the package, taking a `paleobuddy` simulation and returning a `phylo` object from the APE package (see above).\n\n`draw.sim` allows for easy visualization of birth-death simulation objects, drawing species' durations and kinship, besides allowing for the addition of fossil occurrences as well.\n\nBesides its main simulating and visualization functions, `paleobuddy` also supplies the user with a few interesting statistical tools, such as `rexp.var`, a generalization of the `rexp` function in base R that allows for time-varying exponential rates and a `shape` parameter, in which case it generalizes the `rweibull` function.\n\n## Data\n\nGiven the possibility of functions in `paleobuddy` to use environmentally-dependent rates, we have included with the package data frames containing environmental data, namely temperature (`temp`) and co2 (`co2`). These have been modified from data on RPANDA (RPANDA: Morlon H. et al (2016) RPANDA: an R package for macroevolutionary analyses on phylogenetic trees. Methods in Ecology and Evolution 7: 589-597). To see more about the origin of the data, see `?data`, where `data` is the data frame's name.\n\n## Authors\n\n`paleobuddy` was idealized by Bruno do Rosario Petrucci and Tiago Bosisio Quental. The birth-death, statistical, and part of the sampling functions were written by Bruno. The phylogeny and most of the sampling functions were written by Matheus Januário.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrpetrucci%2Fpaleobuddy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbrpetrucci%2Fpaleobuddy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrpetrucci%2Fpaleobuddy/lists"}