depictr 0.2.2
Examples that match the chart
- The precision-recall, gain and lift examples move to an outcome with a scarce positive class, which is the case those charts are documented for. They previously ran on an outcome that was 94 per cent positive, so the gain curve sat on the diagonal and lift hovered at one.
- The calibration example fits a model and plots its predicted probabilities, a reliability curve being a check on a fitted model rather than on a raw score.
- The power-curve article names the effect the shipped simulation actually covers, and its no-simr branch reads a summary derived from that simulation, so the two branches agree by construction.
Fixes
-
vif_plot()restricts its scale to the severity levels present, which removes an empty key entry from the rendered figure.
depictr 0.2.1
Documentation
- The introductory vignette shows
depictr_palette()returning the palette’s hex colours directly, ready forscale_fill_manual()or a base-graphicscol =argument, and showsdepictr_options()setting defaults for every later plot and returning the previous values, so the earlier look can be put back afterwards. -
vignette("diagnostics-and-uncertainty")saves an arranged panel withsave_plot(), which writes at a print-ready 300 dpi by default and creates any missing directories. -
vignette("multivariate-and-survival")addsk_diagnostic(method = "gap"), which compares within-cluster dispersion against a null reference and so, unlike the other two criteria, can supportk = 1. -
vignette("time-series")adds classical decomposition, which holds the seasonal component fixed across the series where STL lets it evolve from year to year. - The
optimizer_fixef_plot()andpower_curve_plot()reference pages describe what each plot shows rather than the prototype gists they grew from. - On the documentation site, source chunks are set a little smaller than the output and the prose, so a typical line fits the narrower home and article columns without horizontal scrolling, and the copy button stays attached to its code block.
depictr 0.2.0
Fixes
-
roc_curve_plot()rejects acithat resolves to fewer than one bootstrap resample with a clear error, instead of silently drawing an all-NAband and an[NA, NA]AUC annotation.
Data
- In
wellbeing_survey, region now genuinely shifts stress and income, which flow through to life satisfaction, so the region-grouped plots (faceted densities, ridgelines, the region dendrogram) compare real contrasts rather than four samples of the same distribution. The bundled datasets are regenerated bydata-raw/generate_datasets.Ras before.
Citation
- The package citation (
inst/CITATIONandCITATION.cff) carries the Zenodo concept DOI, and the citation title uses sentence case.
Documentation
- The package overview (
?depictr) lists every exported function and all five bundled datasets; previously several functions and two datasets were missing. - The
vif_plot()example fits deliberately collinear predictors, so the plot shows inflated VIFs sitting above the threshold line instead of near-identical bars around 1 with the line off the axis. -
depictr_options()describes whatbrandandaccentactually drive, anddepictr_palette()notes that qualitative colours interpolated beyond the base set are not guaranteed to stay distinguishable under colour-vision deficiency. -
lift_plot()documents its own top-right inside-legend corner rather than inheritinggain_plot()‘s bottom-right wording, andDESCRIPTIONnotes that composite panels return ’patchwork’ objects. - References throughout the documentation follow APA 7 and carry DOIs, and spelling is consistently British (en-GB).
- The documentation site’s home page is restructured around a pitch, gallery and signposts; the time-series decomposition example draws its trend confidence band; and
LICENSE.mdcarries the full MIT text so the site’s licence page renders in full, as in the sibling packages.
Packaging and checks
- Example variants that render several multi-panel figures (
posterior_plot(),residual_diagnostics_plot(),decompose_plot()) are wrapped in\donttest{}so each example file stays within CRAN’s five-second budget; the first call of every example still runs. -
CITATION.cffand the test artefactRplots.pdfare excluded from the build tarball, and the test that producedRplots.pdfdraws to a null device instead. - New tests pin the
legend_insidegates: the legend moves inside the panel when a plot’s gate is satisfied and the theme is left alone when it is not.
depictr 0.1.1
- Documentation and packaging polish, with no change to the plotting API.
- The documentation site adopts the shared house style used across the package family, with a citation page carrying a copyable and downloadable BibTeX entry.
- Consolidated to a single
LICENSEfile, and added community and contribution files.
depictr 0.1.0
First release. depictr is a unified, consistent toolkit of publication-ready plots spanning the whole analysis workflow. It grew out of, and generalises, three earlier plotting functions (frequentist_bayesian_plot, plot.fixef.allFit and powercurvePlot).
Exploring data
-
explore_distribution(),explore_categorical(),explore_bivariate(),explore_pairs(),correlation_heatmap(),missingness_map(),outlier_plot(),raincloud_plot(),group_comparison_plot(),scatter_trend()andsummary_table(). -
estimation_plot()for estimation statistics: group effect sizes (mean differences, Cohen’s d / Hedges’ g) with bootstrap confidence intervals, in the spirit of the “new statistics”. -
ecdf_plot()(empirical cumulative distribution, optionally by group),ridgeline_plot()(overlapping per-group densities) anddumbbell_plot()(a connected two-group comparison across categories). -
explore_distribution()gainsfacetto draw one panel per group instead of overlaying them (much clearer beyond a few groups), andcorrelation_heatmap()gainsreorderto cluster correlated variables together.
Multivariate, clustering and survival
-
pca_plot()andscree_plot()(principal component analysis),cluster_plot()(k-means on principal-component axes) anddendrogram_plot()(hierarchical clustering), andsurvival_plot()(Kaplan-Meier curves with a number-at-risk table, median survival and an optional log-rank test, all computed in base R). -
silhouette_plot()andk_diagnostic()help choose and validate the number of clusters (silhouette widths; elbow and average-silhouette diagnostics).
Time series
-
timeseries_plot()(one or more series with an optional moving average),acf_plot()(autocorrelation / partial autocorrelation) anddecompose_plot()(trend / seasonal / remainder decomposition). -
seasonal_plot()(seasonal subseries) andts_forecast()(a simple, dependency-free forecast with prediction intervals).
Model estimates and inference
-
tidy_estimates()– the shared tidy estimate table (methods forlm,glm,merModand data frames; falls back tobroom::tidy()). -
coefficient_plot(),compare_models(),frequentist_bayesian_plot(),effects_plot(),interaction_plot(),random_effects_plot(),optimizer_fixef_plot()andmodel_fit_table(). -
frequentist_bayesian_plot()now draws the full Bayesian posterior for each term as a half-eye density and overlays the matching frequentist point estimate and confidence interval, so the two inferential frameworks can be compared directly. It reads posterior draws frombrmsfit,stanreg,draws/matrixobjects or a data frame.
Diagnostics and classification
-
residual_diagnostics_plot(),influence_plot(),qq_plot(),vif_plot(),roc_curve_plot(),pr_curve_plot(),gain_plot(),lift_plot(),calibration_plot()andconfusion_matrix_plot(). -
binned_residual_plot()(binned residuals for logistic and other GLMs, with approximate error bounds) andthreshold_plot()(classification metrics across decision thresholds, highlighting Youden’s J and the maximum-F1 cut-off).
Uncertainty and power
-
posterior_plot()summarises posterior draws with a choice of styles ("halfeye","interval","gradient"or"dots") and can annotate a region of practical equivalence (ROPE) and the probability of direction. -
power_curve_plot()for power-analysis curves (e.g. fromsimr).
Theming and reporting
-
theme_depictr(),depictr_palette(),scale_colour_depictr()(andscale_color_depictr(),scale_fill_depictr()),palette_preview(),format_terms(),model_report()(a one-figure model overview),arrange_plots()andsave_plot(). -
depictr_options()sets package-wide defaults once – the brand and accent colours, qualitative palette, base font size and family, and the colour used for missing values – which every plot and scale then honours.
Layout and legibility
-
coefficient_plot(),compare_models(),posterior_plot()andfrequentist_bayesian_plot()gain afacet/scalesoption that lays each term out in its own free-scaled panel, so terms on very different scales (a large intercept alongside small slopes) stay legible instead of being squished onto the zero line.frequentist_bayesian_plot()uses this layout by default. - A pass over every plot for legibility:
silhouette_plot()cluster labels no longer clip;raincloud_plot()uses one colour per group across all layers;dendrogram_plot()hides leaf labels for large trees;confusion_matrix_plot()picks each label’s colour from the tile luminance;gain_plot()/lift_plot()label their reference lines;timeseries_plot()shows a single legend; andk_diagnostic()now returns the diagnostic curve as a plot. -
coefficient_plot()gainsstandardise, scaling each coefficient by its predictor’s standard deviation so magnitudes are comparable;model_report()uses it by default, removing the empty band in its coefficient panel. -
vif_plot()shows the ordinary VIF (not its square root) for single-df terms, scales the axis to the data, and draws a single clearly-labelled threshold line (reported in the caption when it is off-axis) – no more wide empty band or hard-to-read guides. -
seasonal_plot(style = "season")reverses its sequential legend so the darkest, most-recent cycle sits at the top, matching the plotted order. - Factor coefficient names are prettified by default to the effect (variable) name –
conditionunrelatedbecomescondition,word_frequencybecomesword frequency– incoefficient_plot(),compare_models()andfrequentist_bayesian_plot()(read from the model);optimizer_fixef_plot()andposterior_plot()gain alabelsargument for the same. Any user-suppliedlabelstake precedence.pca_plot()likewise shows underscores in its loading-arrow labels as spaces (soil_ph->soil ph). - Redundant cluster legends are dropped:
silhouette_plot()(the bands are labelled in place) andcluster_plot()when the centroids are labelled. -
survival_plot(): the log-rank annotation renders a proper chi-squared and an italic p, formatted APA style (no leading zero, p < .001 below that threshold); the median guide is labelled “median”; the y-axis title margin is tighter; and the colour legend and the number-at-risk table list the groups in the same order, following the group factor’s levels. - A
legend_insideargument (off by default) draws the legend inside the panel, over a semi-transparent background, in a corner the plot usually leaves empty – reclaiming the right-hand margin. It is offered byroc_curve_plot(),gain_plot(),lift_plot()(bottom-right / top-right of the curve),ecdf_plot(),survival_plot(),explore_distribution(),dumbbell_plot()andmissingness_map(). For any other plot the same is onetheme()call;vignette("exploring-data")shows how, alongside tidying legend titles. -
theme_depictr()now centres legend titles over their keys, which reads more tidily than ggplot2’s default left alignment – especially for an inside or a top/bottom legend. -
estimation_plot()reserves more headroom above the lower panel so the effect-size annotation (Hedges’ g / Cohen’s d) is never clipped. -
scree_plot()colour-matches and names its dual axes – “Variance explained (bars)” on the left, “Cumulative (line)” on the right. - Statistical letters are italic in annotations: the log-rank p,
model_report()’s n and R, andestimation_plot()’s g / d. - British (en-GB) spelling throughout: the
crop_yieldcolumn is nowfertiliser,coefficient_plot()/model_report()takestandardise, andconfusion_matrix_plot()takesnormalise.
Data
- Five reproducibly simulated datasets:
lexical_decision(counterbalanced priming experiment),wellbeing_survey(with realistic missingness),crop_yield(a fertiliser-by-treatment field trial),clinical_trial(right-censored survival with a rare adverse event) andmonthly_sales(two seasonal retail series).
Accessibility
- The qualitative palette is based on the colourblind-safe Okabe-Ito set (led by the depictr brand blue), and
depictr_palette()providessequentialanddivergingvariants.palette_preview()can show any one, or all three, and can simulate deuteranopia, protanopia or tritanopia so a palette’s legibility can be checked directly.
Notes
- Heavier modelling back-ends (
lme4,broom,simr,survival,brms,posterior,ggdist,cluster,boot) are inSuggestsand used only when available, so the package installs and checks without them. Vignettes draw on small precomputed model fits shipped ininst/extdata/, so they knit without a Bayesian or mixed-model toolchain. - Functions with an optional
seed(cluster_plot(),qq_plot()andresidual_diagnostics_plot()) restore the caller’s random number generator state afterward, so passing one for reproducibility has no side effect on your own subsequent random draws.
