#' @title Example target factory in an R package.#' @export#' @description A target factory to analyze data.#' @return A list of 3 target objects to:#' 1. Track the file for changes,#' 2. Read the data in the file, and#' 3. Analyze the data.#' @param File Character of length 1, path to the file.target_factory <-function(file) {list(tar_target_raw("file", file, format ="file", deployment ="main"),tar_target_raw("data", quote(read_data(file)), format ="fst_tbl", deployment ="main"),tar_target_raw("model", quote(run_model(data)), format ="qs") )}
# R consoletar_manifest()#> # A tibble: 3 x 2#> name command #> <chr> <chr> #> 1 file "\"data.csv\"" #> 2 data "read_data(file)" #> 3 model "run_model(data)"
Bürkner P, Gabry J, Kay M, Vehtari A (2022). “posterior: Tools for Working with Posterior Distributions.” R package version 1.3.1, https://mc-stan.org/posterior/.
Cook, Samantha R., Andrew Gelman, and Donald B. Rubin (2006). “Validation of Software for Bayesian Models Using Posterior Quantiles.” Journal of Computational and Graphical Statistics 15 (3): 675–92. http://www.jstor.org/stable/27594203.
Gabry, J., & Češnovar, R. (2021). “Cmdstanr: R interface to CmdStan”. <https://mc-stan. org/cmdstanr>.
Gelman, A., Aki Vehtari, Daniel Simpson, Charles C. Margossian, Bob Carpenter, Yuling Yao, Lauren Kennedy, Jonah Gabry, Paul-Christian Bürkner, and Martin Modrák (2020). “Bayesian Workflow”. arXiv, https://arxiv.org/abs/2011.01808.
Kim, Shinyoung, Hyunji Moon, Martin Modrák, and Teemu Säilynoja (2022). “SBC: Simulation Based Calibration for Rstan/Cmdstanr Models.”
Landau, W. M. (2021). “The targets R package: A dynamic make-like function-oriented pipeline toolkit for reproducibility and high-performance computing.” Journal of Open Source Software, 6(57), 2959. https://doi.org/10.21105/joss.02959
Landau, W. M., (2021). “The stantargets R package: a workflow framework for efficient reproducible Stan-powered Bayesian data analysis pipelines.” Journal of Open Source Software, 6(60), 3193, https://doi.org/10.21105/joss.03193.
Mallinckrodt, C. H., Lane, P. W., Schnell, D., Peng, Y., Mancuso, J. P. (2008). “Recommendations for the primary analysis of continuous endpoints in longitudinal clinical trials.” Drug information journal, 42, 303-319.
Stan Development Team. (2012). “Stan: A C++ library for probability and sampling.” <https: //mc-stan.org>
Talts, Sean, Michael Betancourt, Daniel Simpson, Aki Vehtari, and Andrew Gelman (2020). “Validating Bayesian Inference Algorithms with Simulation-Based Calibration.” https://arxiv.org/abs/1804.06788.