{"id":13591505,"url":"https://github.com/PredictiveEcology/reproducible","last_synced_at":"2025-04-08T17:31:48.783Z","repository":{"id":37386457,"uuid":"94369212","full_name":"PredictiveEcology/reproducible","owner":"PredictiveEcology","description":"A set of tools for R that enhance reproducibility beyond package management","archived":false,"fork":false,"pushed_at":"2025-04-05T00:18:13.000Z","size":19733,"stargazers_count":40,"open_issues_count":28,"forks_count":17,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-04-05T00:29:08.059Z","etag":null,"topics":["r-package","reproducibility","reproducible-research"],"latest_commit_sha":null,"homepage":"https://reproducible.predictiveecology.org/","language":"R","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/PredictiveEcology.png","metadata":{"files":{"readme":"README.md","changelog":"NEWS.md","contributing":"CONTRIBUTING.md","funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":"CITATION.cff","codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-06-14T20:11:31.000Z","updated_at":"2025-03-22T08:14:20.000Z","dependencies_parsed_at":"2023-10-04T12:27:46.149Z","dependency_job_id":"ef9e6caf-29da-47aa-a19e-21e839006585","html_url":"https://github.com/PredictiveEcology/reproducible","commit_stats":{"total_commits":4012,"total_committers":13,"mean_commits":"308.61538461538464","dds":0.5418743768693919,"last_synced_commit":"c9494c82f17bfd3fb915756d5f8a2e67ff9dad1e"},"previous_names":[],"tags_count":37,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PredictiveEcology%2Freproducible","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PredictiveEcology%2Freproducible/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PredictiveEcology%2Freproducible/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PredictiveEcology%2Freproducible/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PredictiveEcology","download_url":"https://codeload.github.com/PredictiveEcology/reproducible/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247271473,"owners_count":20911586,"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":["r-package","reproducibility","reproducible-research"],"created_at":"2024-08-01T16:00:58.389Z","updated_at":"2025-04-08T17:31:43.767Z","avatar_url":"https://github.com/PredictiveEcology.png","language":"R","funding_links":[],"categories":["Uncategorized","R"],"sub_categories":["Uncategorized"],"readme":"# reproducible\n\n\u003c!-- badges: start --\u003e\n[![CRAN_Status_Badge](https://www.r-pkg.org/badges/version/reproducible)](https://cran.r-project.org/package=reproducible)\n[![CRAN Downloads](https://cranlogs.r-pkg.org/badges/grand-total/reproducible)](https://cran.r-project.org/package=reproducible)\n[![R build status](https://github.com/PredictiveEcology/reproducible/workflows/R-CMD-check/badge.svg)](https://github.com/PredictiveEcology/reproducible/actions)\n[![Codecov test coverage](https://codecov.io/gh/PredictiveEcology/reproducible/branch/master/graph/badge.svg)](https://app.codecov.io/gh/PredictiveEcology/reproducible?branch=master)\n\u003c!-- badges: end --\u003e\n\nA set of tools for R that enhance reproducibility for data analytics and forecasting.\nThis package aims at making high-level, robust, machine and OS independent tools for making deeply reproducible and reusable content in R.\nThe suggested package `geodata` can be installed from the repository \n(\u003chttps://PredictiveEcology.r-universe.dev\u003e).\n\n## News\n\nSee updates from latest [CRAN](https://cran.r-project.org/package=reproducible) and [development](https://github.com/PredictiveEcology/reproducible/blob/development/NEWS.md) versions.\nNote that versions 2.0.0 and later are not compatible with previous versions.\nThe current version can be much faster and creates smaller repository files (each with specific options set using `Suggests` packages) and allows for different (e.g., `RPostgres` backends for the database[^1] -- not the saved files, however; these are still saved locally).\n\n[^1]: \u003chttps://github.com/PredictiveEcology/SpaDES/wiki/Using-alternate-database-backends-for-Cache\u003e\n\n# Reproducible workflows\n\nA reproducible workflow is a series of code steps (e.g., in a script) that, when run, produce the same output from the same inputs every time.\nThe big challenge with such a workflow is that many steps are so time consuming that a scientist tends to _not_ re-run each step every time. After many months of work, it is often unclear if the code will actually function from the start.\nIs the original dataset still there? Have the packages that were used been updated? Are some of the steps missing because there was some \"point and clicking\"? \n\nThe best way to maintain reproducibility is to have all the code re-run _all the time_.\nThat way, errors are detected early and can be fixed.\nThe challenge is how to make all the steps fast enough that it becomes convenient to re-run everything from scratch each time.\n\n## `Cache`\n\nCaching is the principle tool to achieve this reproducible work-flow.\nThere are many existing tools that support some notion of _caching_.\nThe main tool here, `Cache`, can be nested hierarchically, becoming very powerful for the data science developer who is regularly working at many levels of an analysis.\n\n```\nrnorm(1) # give a random number\nCache(rnorm, 1) # generates a random number\nCache(rnorm, 1) # recovers the previous random number because call is identical\n```\n\n## `prepInputs`\n\nA common data problem is starting from a raw (spatial) dataset and getting it into shape for an analysis.\nOften, copies of a dataset are haphazardly placed in *ad hoc* local file systems.\nThis makes it particularly difficult to share the workflow. The solution to this is use a canonical location (e.g., cloud storage, permalink to original data provider, etc.) and use tools that are smart enough to download only once.\n\nGet a geospatial dataset. It will be checksummed (locally), meaning if the file is already in place locally, it will not download it again. \n\n```\n# Using dlFun -- a custom download function -- passed to preProcess\ntest1 \u003c- prepInputs(targetFile = \"GADM_2.8_LUX_adm0.rds\", # must specify currently\n                    dlFun = \"raster::getData\", name = \"GADM\", country = \"LUX\", level = 0,\n                    path = dPath)\n```\n\n## `Cache` with `prepInputs`\n\nPutting these tools together allows for very rich data flows.\nFor example, with `prepInputs` and using the `fun` argument or passing a `studyArea`, a raw dataset can be downloaded, loaded into R, and post processed -- all potentially very time consuming steps resulting in a clean, often much smaller dataset.\nWrapping all these with a `Cache` can make it very quick.\n\n```\ntest1 \u003c- Cache(prepInputs, targetFile = \"GADM_2.8_LUX_adm0.rds\", # must specify currently\n                    dlFun = \"raster::getData\", name = \"GADM\", country = \"LUX\", level = 0,\n                    path = dPath)\n```                    \n\nSee vignettes and help files for many more real-world examples.\n\n## Installation\n\n### Current release (on CRAN)\n\n[![R build status](https://github.com/PredictiveEcology/reproducible/workflows/R-CMD-check/badge.svg?branch=master)](https://github.com/PredictiveEcology/reproducible/actions)\n[![Codecov test coverage](https://codecov.io/gh/PredictiveEcology/reproducible/branch/master/graph/badge.svg)](https://app.codecov.io/gh/PredictiveEcology/reproducible?branch=master)\n\n**Install from CRAN:**\n\n```r\ninstall.packages(\"reproducible\")\n```\n\n**Install from GitHub:**\n    \n```r\n#install.packages(\"devtools\")\nlibrary(\"devtools\")\ninstall_github(\"PredictiveEcology/reproducible\", dependencies = TRUE) \n```\n\n### Development version\n\n[![R build status](https://github.com/PredictiveEcology/reproducible/workflows/R-CMD-check/badge.svg?branch=development)](https://github.com/PredictiveEcology/reproducible/actions)\n[![Codecov test coverage](https://codecov.io/gh/PredictiveEcology/reproducible/branch/development/graph/badge.svg)](https://app.codecov.io/gh/PredictiveEcology/reproducible?branch=development)\n\n**Install from GitHub:**\n\n```r\n#install.packages(\"devtools\")\nlibrary(\"devtools\")\ninstall_github(\"PredictiveEcology/reproducible\", ref = \"development\", dependencies = TRUE) \n```\n\n## Contributions\n\nPlease see `CONTRIBUTING.md` for information on how to contribute to this project.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FPredictiveEcology%2Freproducible","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FPredictiveEcology%2Freproducible","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FPredictiveEcology%2Freproducible/lists"}