44 Function-to-recipe map
Use this map when you know the function name but not the recipe. It answers the question that arrives when you are reading someone else’s script: what is hv_atrisk_compose(), and where in this book is it worked through?
The map is a shortcut back to a reproducible example, not a substitute for one. It keeps a function lookup from becoming an invitation to reconstruct a workflow from its argument list.
44.1 How to read it
Role says what the function is for in one line. Recipe links to the chapter that works it through. Coverage distinguishes a function this book demonstrates from one it names but leaves to the package reference.
The table is generated rather than typed. The function lists below are an explicit contract, and the chapter column is computed by scanning the book’s own sources at render time, so the two can disagree and say so. If a function is added to the contract and no chapter picks it up, its coverage flips to Package reference on the next render without anyone remembering to update a list.
This book works through 85 of the 85 workflow-level functions in the contract.
44.1.1 hvtiR
| Function | Role | Recipe | Coverage |
|---|---|---|---|
install() |
Install the whole hvtiR family on a fresh machine | packages | Worked recipe |
status() |
Compare installed family versions against GitHub main | packages | Worked recipe |
update() |
Install only the missing or stale family members | packages | Worked recipe |
doctor() |
Diagnose R, pak, GitHub access, and member status | packages | Worked recipe |
44.1.2 hvtiPlotR
| Function | Role | Recipe | Coverage |
|---|---|---|---|
hv_alluvial() |
Alluvial flow across milestones | sankey | Worked recipe |
hv_atrisk() |
Numbers-at-risk table aligned to a time axis | figure_tables, survival, temporal_fit | Worked recipe |
hv_atrisk_compose() |
Stack a curve over its numbers-at-risk panel | figure_tables, survival, temporal_fit | Worked recipe |
hv_balance() |
Covariate balance before and after adjustment | balance, combination | Worked recipe |
hv_consort() |
CONSORT patient-flow diagram | consort | Worked recipe |
hv_consort_exclude() |
Add an exclusion arm to a CONSORT flow | consort | Worked recipe |
hv_consort_patients() |
Add a retained-patients node to a CONSORT flow | consort | Worked recipe |
hv_consort_start() |
Open a CONSORT flow at the screened cohort | consort | Worked recipe |
hv_consort_summary() |
Summarise a CONSORT flow as counts | consort | Worked recipe |
hv_eda() |
Quick exploratory view of a data frame | bar, scatter | Worked recipe |
hv_followup() |
Follow-up completeness over time | balance | Worked recipe |
hv_ggsave_dims() |
Fix the panel content area, not the file size | manuscripts, researchday, summary | Worked recipe |
hv_hazard() |
Parametric or life-table hazard estimate | hazard | Worked recipe |
hv_legend_inside() |
Put a key in the emptiest corner of the panel | annotation, bar, hazard, legends, rf_rhf, themes | Worked recipe |
hv_longitudinal() |
Longitudinal counts with a composite panel | bar, figure_tables | Worked recipe |
hv_mirror_hist() |
Back-to-back histogram for two groups | histograms | Worked recipe |
hv_nnt() |
Number needed to treat over follow-up | nnt | Worked recipe |
hv_nonparametric() |
Nonparametric hazard and cumulative hazard | hazard | Worked recipe |
hv_ordinal() |
Ordinal outcome over time | hazard | Worked recipe |
hv_ph_location() |
Slide coordinates so a panel lands in the same place | manuscripts | Worked recipe |
hv_ppt_palette() |
The slide palette on its own | annotation, colors, presentations | Worked recipe |
hv_ppt_series() |
Matched colour and shape scales plus a slide theme | annotation, colors, presentations, summary | Worked recipe |
hv_sankey() |
Sankey flow between cluster states | sankey | Worked recipe |
hv_spaghetti() |
Per-patient trajectories across repeated measures | spaghetti | Worked recipe |
hv_stacked() |
Stacked categorical composition | histograms | Worked recipe |
hv_survival() |
Kaplan-Meier survival estimate and its risk table | annotation, colors, combination, figure_tables, legends, manuscripts, presentations, researchday, survival, themes, usingR | Worked recipe |
hv_survival_difference() |
Difference between two survival curves | nnt | Worked recipe |
hv_trends() |
Grouped trend series over time | annotation, colors, legends, presentations, spaghetti, themes | Worked recipe |
hv_upset() |
UpSet plot of set intersections | upset | Worked recipe |
hv_venn() |
Venn diagram for two or three sets | upset | Worked recipe |
save_manuscript() |
Write a manuscript-geometry figure file | manuscripts, summary | Worked recipe |
save_ppt() |
Write the plot onto a slide as editable vector shapes | manuscripts, presentations, summary | Worked recipe |
theme_hv_manuscript() |
Journal theme: small type, minimal chrome, no legend | annotation, balance, bar, boxplots, colors, combination, consort, density, figure_tables, hazard, histograms, legends, manuscripts, nnt, packages, postagestamp, rf_dependence, rf_error, rf_predicted, rf_rhf, rf_roc, rf_shap, rf_vimp, sankey, scatter, spaghetti, summary, survival, temporal_diagnostics, temporal_fit, temporal_prediction, themes, upset, usingR, varpro_partial, varpro | Worked recipe |
theme_hv_poster() |
Poster theme: large type for arm’s-length reading | annotation, histograms, packages, researchday, scatter, summary, survival, themes | Worked recipe |
theme_hv_ppt_dark() |
Slide theme for navy or dark-gradient decks | annotation, manuscripts, presentations, themes | Worked recipe |
theme_hv_ppt_light() |
Slide theme for white or light-grey backgrounds | annotation, presentations, themes | Worked recipe |
44.1.3 hvtiRtables
| Function | Role | Recipe | Coverage |
|---|---|---|---|
hv_tbl_summary() |
Summarise a cohort into a Table 1 | hv_tables | Worked recipe |
hv_man_table() |
Render a summary as a manuscript table | hv_tables | Worked recipe |
hv_man_footnotes() |
Attach footnotes to a manuscript table | hv_tables | Worked recipe |
hv_man_table_save() |
Write a manuscript table to Word | hv_tables | Worked recipe |
hv_check_docx() |
Check a written Word table against the format rules | hv_tables | Worked recipe |
hv_man_table_jtcvs() |
Render a table in the JTCVS format | hv_tables | Worked recipe |
hv_test_footnotes_jtcvs() |
JTCVS footnote conventions for test results | hv_tables | Worked recipe |
hv_man_table_save_jtcvs() |
Write a JTCVS-format table to Word | hv_tables | Worked recipe |
44.1.4 ggRandomForests
| Function | Role | Recipe | Coverage |
|---|---|---|---|
gg_error() |
Out-of-bag error against the number of trees | rf_error | Worked recipe |
gg_rfsrc() |
Predicted response or survival from a forest | rf_predicted | Worked recipe |
gg_survival() |
Empirical survival estimate for comparison | rf_predicted | Worked recipe |
gg_vimp() |
Permutation variable importance | rf_dependence, rf_vimp | Worked recipe |
gg_shap() |
Per-observation SHAP attributions | packages, rf_dependence, rf_shap | Worked recipe |
gg_variable() |
Predicted response against a predictor’s own values | rf_dependence | Worked recipe |
gg_partial_rfsrc() |
Partial dependence with other predictors averaged out | rf_dependence | Worked recipe |
gg_roc() |
ROC curve for a classification forest | rf_roc | Worked recipe |
gg_brier() |
Brier score over time | rf_roc | Worked recipe |
gg_varpro() |
varPro rule-based variable priority | varpro | Worked recipe |
gg_beta_varpro() |
Beta-refined varPro importance | varpro | Worked recipe |
gg_ivarpro() |
Individual-level varPro priority | varpro | Worked recipe |
gg_isopro() |
Isolation and anomaly scores | varpro | Worked recipe |
gg_beta_uvarpro() |
Beta-refined importance for an unsupervised fit | varpro | Worked recipe |
gg_udependent() |
Dependency graph among predictors | rf_dependence, varpro | Worked recipe |
gg_sdependent() |
Ranked signal-variable detection | rf_dependence, varpro | Worked recipe |
gg_partial_varpro() |
Partial dependence for varPro-selected variables | varpro_partial, varpro | Worked recipe |
gg_rhf() |
Pointwise and cumulative hazard from a Random Hazard Forest | rf_rhf | Worked recipe |
gg_auct() |
Time-varying AUC for an RHF fit | rf_rhf | Worked recipe |
gg_rhf_importance() |
Time-localized variable priority for an RHF fit | rf_rhf | Worked recipe |
gg_tune_rhf() |
Read a completed RHF tree-size tuning path | rf_rhf | Worked recipe |
44.1.5 TemporalHazard
| Function | Role | Recipe | Coverage |
|---|---|---|---|
hazard() |
Fit an additive multi-phase hazard model | temporal_diagnostics, temporal_fit, temporal_migration, temporal_prediction | Worked recipe |
hzr_argument_mapping() |
Map SAS HAZARD arguments onto the R interface | temporal_migration | Worked recipe |
hzr_bootstrap() |
Bootstrap uncertainty for a hazard fit | temporal_diagnostics | Worked recipe |
hzr_calibrate() |
Calibration of predicted against observed risk | temporal_diagnostics | Worked recipe |
hzr_competing_risks() |
Competing-risks decomposition | temporal_diagnostics | Worked recipe |
hzr_deciles() |
Observed against expected by risk decile | temporal_diagnostics | Worked recipe |
hzr_gof() |
Goodness-of-fit summary | temporal_diagnostics | Worked recipe |
hzr_kaplan() |
Kaplan-Meier comparison for a hazard fit | temporal_fit, temporal_prediction | Worked recipe |
hzr_nelson() |
Nelson-Aalen comparison for a hazard fit | temporal_fit, temporal_prediction | Worked recipe |
hzr_phase() |
Define a hazard phase | temporal_diagnostics, temporal_fit, temporal_migration, temporal_prediction | Worked recipe |
hzr_phase_cumhaz() |
Phase-specific cumulative hazard | temporal_fit, temporal_prediction | Worked recipe |
hzr_phase_hazard() |
Phase-specific hazard estimates | temporal_fit, temporal_prediction | Worked recipe |
hzr_read_outhaz() |
Read a SAS OUTHAZ data set | temporal_migration | Worked recipe |
hzr_stepwise() |
Stepwise variable selection for a hazard model | temporal_diagnostics | Worked recipe |
hzr_translate_sas() |
Translate a SAS HAZARD call into R | temporal_migration | Worked recipe |
stepwise_trace() |
Inspect the path a stepwise selection took | temporal_diagnostics | Worked recipe |
44.2 What the map does not cover
Lower-level helpers, S3 methods reached through plot() or print(), and compatibility shims kept for older scripts are all deliberately absent. So are the deprecated theme aliases: theme_hv_manuscript() and its siblings are the current names, and the older hv_theme_*() and theme_man() forms still work but should not be written into new code.
If you are looking for a function that is not here, it is either one of those or it is new since this edition. hvtiR::status() will tell you which.