- Notifications
You must be signed in to change notification settings - Fork78
Function-oriented Make-like declarative workflows for R
License
Unknown and 2 other licenses found
Licenses found
ropensci/targets
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
Pipeline tools coordinate the pieces of computationally demandinganalysis projects. Thetargets package is a Make-like pipeline toolfor statistics and data science in R. The package skips costly runtimefor tasks that are already up to date, orchestrates the necessarycomputation with implicit parallel computing, and abstracts files as Robjects. If all the current output matches the current upstream code anddata, then the whole pipeline is up to date, and the results are moretrustworthy than otherwise.
A pipeline is a computational workflow that does statistics, analytics,or data science. Examples include forecasting customer behavior,simulating a clinical trial, and detecting differential expression fromgenomics data. A pipeline contains tasks to prepare datasets, runmodels, and summarize results for a business deliverable or researchpaper. The methods behind these tasks are user-defined R functions thatlive in R scripts, ideally in a folder called"R/" in the project. Thetasks themselves are called “targets”, and they run the functions andreturn R objects. Thetargets package orchestrates the targets andstores the output objects to make your pipeline efficient, painless, andreproducible.
- Familiarity with theR programminglanguage, covered inR for DataScience.
- Data science workflow managementtechniques.
- How to write functions toprepare data, analyze data, and summarize results in a data analysisproject.
If you are usingtargetswithcrew for distributedcomputing, it isrecommended to usecrew version0.4.0 or higher.
install.packages("crew")There are multiple ways to install thetargets package itself, andboth the latest release and the development version are available.
| Type | Source | Command |
|---|---|---|
| Release | CRAN | install.packages("targets") |
| Development | GitHub | pak::pkg_install("ropensci/targets") |
| Development | rOpenSci | install.packages("targets", repos = "https://dev.ropensci.org") |
The 4-minute video athttps://vimeo.com/700982360 demonstrates theexample pipeline used in thewalkthrough andfunctions chaptersof theuser manual. Visithttps://github.com/wlandau/targets-four-minutes for the code andhttps://rstudio.cloud/project/3946303 to try out the code in a browser(no download or installation required).
To create a pipeline of your own:
- Write Rfunctions for apipeline and save them to R scripts (ideally in the
"R/"folder ofyour project). - Call
use_targets()to write key files, including the vital_targets.Rfile whichconfigures and defines the pipeline. - Follow the comments in
_targets.Rto fill in the details of yourspecific pipeline. - Check the pipeline with
tar_visnetwork(),run it withtar_make(),and read output withtar_read().Morefunctionsare available.
- User manual: in-depthdiscussion about how to use
targets. The most important chapters arethewalkthrough,help guide, anddebugging guide. - Reference website: formaldocumentation of all user-side functions, the statement of need, andmultiple design documents of the internal architecture.
- Developer documentation:software design documents for developers contributing to the deepinternal architecture of
targets.
Please read thehelpguide to learn how bestto ask for help usingtargets.
- Get started with
targetsin 4 minutes(4:08) - Powerful simulation pipelines with
targets.useR! 2025Conference(1:00:25). targetsin ActionwithJoel Nitta andEricScott.rOpenSci CommunityCall (1:09:56).targetsandcrewfor clinical trial simulationpipelines.R/Pharma 2023 (1:57:22).targetsandstantargetsfor Bayesian model validationpipelines. R/Medicine 2021 (15:33)- Reproducible computation at scale in R with
targetsNew York Open StatisticalProgramming Meetup, December 2020 (1:54:28). - ds-incubator series,2021byMauro Lepore.
- Introducción a targets.Irene Cruz, R-Ladies Barcelona, 2021-05-25 (1:25:12).
- Four-minute example
- Minimal example
- Machine learning withKeras
- Validate a minimal Stanmodel
- Using Target Markdown and
stantargetsto validate a Bayesianlongitudinal model for clinical trial dataanalysis - Shiny app that runs apipeline
- Deploy a pipeline to RStudioConnect
tar_watch():a built-in Shiny app to visualize progress while a pipeline isrunning. Available as a Shiny module viatar_watch_ui()andtar_watch_server().targetsketch: a Shinyapp to help sketch pipelines(app,source).
tar_github_actions()sets up a pipeline to run on GitHub Actions. Theminimalexample demonstrates thisapproach.
- R Targetopia: a collection ofR packages thatextend
targets.Thesepackages simplifypipeline construction for specific fields of Statistics and datascience. - Targetfactories:a programming technique to write specialized interfaces for custompipelines. Postshereandheredescribe how.
Please note that this package is released with aContributor Code ofConduct.
citation("targets")Tocitetargetsinpublicationsuse:Landau,W.M., (2021).ThetargetsRpackage:adynamicMake-likefunction-orientedpipelinetoolkitforreproducibilityandhigh-performancecomputing.JournalofOpenSourceSoftware,6(57),2959,https://doi.org/10.21105/joss.02959ABibTeXentryforLaTeXusersis@Article{,title= {ThetargetsRpackage:adynamicMake-likefunction-orientedpipelinetoolkitforreproducibilityandhigh-performancecomputing},author= {WilliamMichaelLandau},journal= {JournalofOpenSourceSoftware},year= {2021},volume= {6},number= {57},pages= {2959},url= {https://doi.org/10.21105/joss.02959}, }
About
Function-oriented Make-like declarative workflows for R
Topics
Resources
License
Unknown and 2 other licenses found
Licenses found
Code of conduct
Contributing
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Packages0
Uh oh!
There was an error while loading.Please reload this page.

