update project design

This commit is contained in:
2026-06-03 22:06:23 -08:00
parent 49409a7d1b
commit 73e5d46c30
27 changed files with 490 additions and 8513 deletions
+24
View File
@@ -0,0 +1,24 @@
# Simulate an ICU cohort for learning target trial emulation.
# The simulation logic lives in R/simulate_icu_cohort.R.
# suppressPackageStartupMessages() keeps package startup text out of the console.
# This makes the important output easier to read when learning.
suppressPackageStartupMessages({
library(skimr)
})
# source() runs another R file.
# After this line runs, simulate_icu_cohort() is available in this script.
source("R/simulate_icu_cohort.R")
# This calls our reusable simulation function.
# n_patients controls the number of rows.
# seed controls reproducibility.
icu_data <- simulate_icu_cohort(n_patients = 1000, seed = 20260531)
# cli::cli_alert_success() prints a nicely formatted success message.
cli::cli_alert_success("Simulated an in-memory ICU cohort with {nrow(icu_data)} patients.")
# skim() gives a quick learner-friendly overview of the dataset.
# It shows variable types, missingness, summary statistics, and small histograms.
skim(icu_data)