Package: fabricatr 2.0.0

Alexander Coppock

fabricatr: Tidyverse-First Data Fabrication

Helps you imagine your data before you collect it. Builds a data frame one column at a time, with hierarchical levels, cross-classified levels, potential outcomes, and draws with a target intra-cluster correlation, so that a research design can be simulated and diagnosed before any data exist. Version 2.0 is a rewrite of the same public API on 'dplyr', 'tibble', 'purrr', and 'rlang'.

Authors:Alexander Coppock [aut, cre], Graeme Blair [aut], Jasper Cooper [aut], Macartan Humphreys [aut], Aaron Rudkin [aut], Neal Fultz [aut], David C. Hall [ctb]

fabricatr_2.0.0.tar.gz
fabricatr_2.0.0.zip(r-4.7-any)fabricatr_2.0.0.zip(r-4.6-any)fabricatr_2.0.0.zip(r-4.5-any)
fabricatr_2.0.0.tgz(r-4.6-any)fabricatr_2.0.0.tgz(r-4.5-any)
fabricatr_2.0.0.tar.gz(r-4.7-any)fabricatr_2.0.0.tar.gz(r-4.6-any)
fabricatr_2.0.0.tgz(r-4.6-emscripten)
manual.pdf |manual.html✨
DESCRIPTION |NEWS
card.svg |card.png
fabricatr/json (API)

# Install 'fabricatr' in R:
install.packages('fabricatr', repos = c('https://declaredesign.r-universe.dev', 'https://cloud.r-project.org'))

Bug tracker:https://github.com/declaredesign/fabricatr/issues

Pkgdown/docs site:https://declaredesign.org

On CRAN:

Conda:

11.15 score 93 stars 8 packages 510 scripts 3.5k downloads 28 exports 16 dependencies

Last updated from:b9cbb0afd1. Checks:9 OK. Indexed: yes.

TargetResultTimeFilesSyslog
linux-develOK159
source / vignettesOK181
linux-releaseOK117
macos-releaseOK107
macos-oldrelOK100
windows-develOK80
windows-releaseOK63
windows-oldrelOK74
wasm-releaseOK89

Exports:add_levelALLcorrelatecross_levelsdeclare_leveldraw_binarydraw_binary_iccdraw_binomialdraw_categoricaldraw_countdraw_likertdraw_multivariatedraw_normal_ardraw_normal_iccdraw_ordereddraw_quantilefabricatefabricate_with_dotsimport_leveljoin_usinglink_levelsmodify_levelnest_levelpotential_outcomesrecycleresample_datareveal_outcomessplit_quantile

Dependencies:clidplyrgenericsgluelifecyclemagrittrpillarpkgconfigpurrrR6rlangtibbletidyselectutf8vctrswithr

fabricatr: what changes, what does not, and why
The short version | Getting it | What does not change | What changes, and why | nest = FALSE becomes declare_level() | join_using() becomes .by | by becomes .by in modify_level() | N must be named | The result is a tibble | modify_level() at a named level works at that level | reveal_outcomes() keeps the type of the outcome | ID columns are zero-padded character, as in 1.x | total_sd is a parameter, not a rescaling | The correlated draw does not depend on your machine | On reproducing an old seed | N is never a column | Porting an existing script | What is new | Existing data frames come in as levels | n() counts the rows in hand | Panels with persistent shocks | Speed | Why rewrite at all | Upstream issues | Other changes worth knowing

Last update: 2026-10-24
Started: 2026-10-24

Getting started
One level | Two levels | Potential outcomes | Draws that look like real variables | Resampling | Where to read next

Last update: 2026-10-24
Started: 2026-10-24

Readme and manuals

Help Manual

Help pageTopics
Add a level, nested in the one before it if there is oneadd_level
Keep every unit at a resampling levelALL
Generate a variable correlated with an existing variablecorrelate
Create a full Cartesian product of declared levelscross_levels
Declare an independent level for cross-classificationdeclare_level
Draw binary (0/1) outcomesdraw_binary
Draw binary data with a target intra-cluster correlationdraw_binary_icc
Draw binomial countsdraw_binomial
Draw categorical outcomesdraw_categorical
Draw Poisson count datadraw_count
Recode a latent variable into a Likert responsedraw_likert
Draw multivariate random variablesdraw_multivariate
Draw normally distributed data with serial correlation within clustersdraw_normal_ar
Draw normally distributed data with a target intra-cluster correlationdraw_normal_icc
Draw ordered categorical outcomes from a latent variabledraw_ordered
Draw quantile bucket assignmentsdraw_quantile
Fabricate a data framefabricate
Fabricate from a list of quosuresfabricate_with_dots
Import an existing data frame as a levelimport_level
Name the levels to cross or linkjoin_using
Sample N rows from a Cartesian product with optional correlationlink_levels
Modify columns of an existing level, or of the rows in handmodify_level
Nest a level in the one before it (same as a later add_level())nest_level
Build potential outcomes columnspotential_outcomes
Recycle a vector to the length of the level being builtrecycle
Resample a data frame, with optional hierarchical cluster resamplingresample_data
Reveal observed outcomes from potential outcomes columnsreveal_outcomes
Split data into quantile bucketssplit_quantile