Package: cs9 26.11.18

Richard Aubrey White

cs9: A Framework for Real-Time Analysis and Disease Surveillance

A comprehensive framework for building real-time disease surveillance systems. Provides R6-based infrastructure for database-driven surveillance tasks, with support for parallel processing, data validation, and automated pipeline execution. Designed for epidemiological analysis and public health monitoring applications.

Authors:Richard Aubrey White [aut, cre], Folkehelseinstituttet [cph]

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

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

Bug tracker:https://github.com/niphr/cs9/issues

Pkgdown/docs site:https://niphr.github.io

On CRAN:

Conda:

5.31 score 1 packages 6 scripts 27 exports 86 dependencies

Last updated from:2b4abba934. Checks:6 OK, 3 ERROR. Indexed: yes.

TargetResultTimeFilesSyslog
linux-develOK384
source / vignettesOK298
linux-releaseOK370
macos-releaseOK469
macos-oldrelOK331
windows-develERROR346
windows-releaseERROR279
windows-oldrelERROR335
wasm-releaseOK129

Exports:check_environment_setupcheck_staged_against_livecompare_staged_to_liveconfigcreate_folder_if_doesnt_existcreate_latest_folderget_config_data_hash_for_each_planget_config_logget_config_tables_last_updatedget_config_tasks_statsmandatory_db_filterpathpath_getpath_lspath_putreload_db_configrun_task_detachedrun_task_sequentially_as_callr_bg_using_load_allrun_task_sequentially_as_rstudio_job_using_load_allrun_todaySurveillanceSystem_v9synthetic_grid_generatorsynthetic_weekssynthetic_yearsTaskJobupdate_config_loguse_sqlite_default

Dependencies:askpassbitbit64blobcachemcallrclicliprcodetoolscpp11crayoncredentialscsdbcstimecsutilcurldata.tableDBIdbplyrdescdigestdplyrfarverfastmapfilelockforeachfsgenericsgertggplot2gitcredsgluegtablehmshttr2iniisobanditeratorsjsonlitelabelinglaterlifecyclelubridatemagrittrmemoiseodbcopensslotelpakpbmcapplypillarpkgconfigplnrprettyunitsprocessxprogressprogressrpspurrrR6rappdirsRColorBrewerRcpprlangrprojrootRSQLiterstudioapiS7scalesstringistringrsystibbletidyrtidyselecttimechangeusethisutf8uuidvctrsviridisLitewhiskerwithryamlyyjsonrzip

Synthetic data in a surveillance system
A small system | Attach a SyntheticTable to a table | set_synthetic() | set_synthetic_world() | populate_synthetic() and the join check | synthetic_grid_generator() | populate_synthetic(derive = ) | add_source() and source() | run-task.sh --synthetic

Last update: 2026-11-17
Started: 2026-11-07

File Layout
Starting from the example package | 00_env_and_namespace.R | 01_definitions.R | 02_surveillance_systems.R | 03_tables.R | 04_tasks.R | 05_deliverables.R | 10_onLoad.R | 11_onAttach.R | Task files | weather_download_and_import_rawdata.R | weather_clean_data.R | weather_export_weather_plots.R | Files on a share | Notes | Next steps

Last update: 2026-11-10
Started: 2023-03-09

Rebuilding a table safely
The task | A run that succeeds | A run that fails, and its retry | The publish on PostgreSQL | What you need to know when you write a task

Last update: 2026-10-16
Started: 2026-10-12

Task shapes
Setup | Per-unit rebuild | Staged import | Per-plan staged swap | Staging as a checkpoint | Fit then fill | Export from a finished table | Notify after export | Three rules

Last update: 2026-10-16
Started: 2026-10-05

Database backends
The two environments | Which variable each backend reads | What check_environment_setup() asks for | Setting the variables from another package | Which one to use

Last update: 2026-10-16
Started: 2026-08-05

Installation
Start here: SQLite, with no server | What SQLite does not need | cs9example needs no .Renviron at all | Which backend to use | Installation options | CRAN installation (limited functionality) | Full installation (database-driven surveillance) | Database setup | PostgreSQL installation | Option 1: Docker (recommended) | Option 2: System installation | Database schema setup | Environment variable configuration | Setting up .Renviron | Variable descriptions | Package behavior without database configuration | Docker | Apache Airflow Integration | Airflow scheduling pattern | Benefits of Airflow + CS9 | Docker Compose with Airflow | Moving from CRAN to full setup | Verification and troubleshooting | Verify your setup | Common issues | Next steps

Last update: 2026-10-16
Started: 2023-03-07

How a task runs
Setup | A run in one diagram | A plan is one data pull | Analyses iterate within a plan | Only the first and the last plan run in a fixed order | A forked worker MUST NOT inherit an open connection | A task reads cores when it runs | A task builds its plans once per run | A completeness check covers every declared partition | plnr::expand_list() makes one argset per element | Size a plan by its data pull

Last update: 2026-10-15
Started: 2026-10-06

Creating a task
Overview | Prerequisites | Step 1: Initialize a surveillance system | Step 2: Define database tables | Step 3: Implement task functions | Data selector function | Action function | Step 4: Configure the task | Step 5: Execute the task | Step 6: Monitor and debug tasks | Advanced task features | Parallel processing | Dynamic plan generation | Best practices | Error handling | Data validation | Modular design | Summary | See also

Last update: 2026-10-06
Started: 2025-08-20

Introduction to CS9
The problem: scaling epidemiological analysis | NorSySS: a decade of operation | CS9 vs alternatives | What is CS9? | When to use CS9 | What CS9 does not decide for you | Key concepts and definitions | Surveillance system architecture | Example workflow | Plan-heavy or analysis-heavy tasks? | Other vignettes | Example | Surveillance system setup | Database table definition | Task configuration | for_each_plan | plnr::expand_list | for_each_analysis | universal_argset | upsert_at_end_of_each_plan | insert_at_end_of_each_plan | action_fn_name | data_selector_fn_name | schema | data_selector_fn | action_fn | Run the task | Common task patterns | Importing data | Analysis | Exporting multiple sets of results | Exporting combined results | Deployment | What the framework handles for you | Getting started | Next steps

Last update: 2026-08-06
Started: 2024-05-27

Readme and manuals

Help Manual

Help pageTopics
Check Environment Setupcheck_environment_setup
Check a comparison of staged and live rows against rulescheck_staged_against_live
Compare the staged rows of a task run with the live rowscompare_staged_to_live
Flags/values to be used in the 'dashboards' sceneconfig
Create Folder If It Doesn't Existcreate_folder_if_doesnt_exist
Create Latest Foldercreate_latest_folder
Get Configuration Data Hash for Each Planget_config_data_hash_for_each_plan
Get Configuration Logget_config_log
Get Configuration Tables Last Updatedget_config_tables_last_updated
Get Configuration Tasks Statisticsget_config_tasks_stats
Filter surveillance data by standard epidemiological dimensionsmandatory_db_filter
Get Results Folder Pathpath
Download a file or a folder under CS9_PATH from the same path on the sharepath_get
List the entries of a folder on the sharepath_ls
Upload a file under CS9_PATH to the same path on the sharepath_put
Reload the database configuration from the environmentreload_db_config
Run a cs9 task in a detached processrun_task_detached
Run a cs9 task in a background process, streaming its output liverun_task_sequentially_as_callr_bg_using_load_all
Run a Task Sequentially as an RStudio Jobrun_task_sequentially_as_rstudio_job_using_load_all
The date of the task runrun_today
A Surveillance System ObjectSurveillanceSystem_v9
A generator that gives one row per combination of world elementssynthetic_grid_generator
The time columns of weeks and of isoyearssynthetic_weeks synthetic_years
TaskJob R6 ClassTaskJob
Update Configuration Logupdate_config_log
Use SQLite databases in one directory as the database configurationuse_sqlite_default