Skip to contents

saros 1.6.3

Bug Fixes

  • sort_indep_by = ".variable_label" combined with descend_indep = TRUE no longer returns a scrambled order instead of a reversed one. add_indep_order() built the order column with order(-rank(x)), but .indep_order is consumed as a per-row rank while order() returns a permutation. The two coincide only when every category contributes the same number of rows to the summary, so the mistake cancelled out in the common case and surfaced whenever they did not – a group where nobody chose a given response, or showNA = "ifany" with missing values in only some groups. Ascending order was unaffected. Note that it orders by factor level rather than alphabetically as documented; that separate discrepancy is #617 (#614)
  • sigtest_table_* now accepts several indep variables when the dependent variable is numeric, as it already did for a categorical one. summarize_int_cat_data() passed the whole indep vector to dplyr::bind_rows(.id = ), which takes a single column name, and the list it stacked was unnamed anyway, so the call aborted. The blocks are now named and identified by a .indep_name column, with .indep_order computed within each, so sort_indep_by resolves separately per independent variable. cat_* and int_* continue to reject several indep variables with their existing message; only sigtest_table_* and chr_table_html support them (#613)
  • sort_indep_by and descend_indep are no longer silently ignored when the dependent variable is numeric. generate_data_summary() passed them to summarize_cat_cat_data() but not to summarize_int_cat_data(), which never called the sorting machinery, so the summary carried no .indep_order and int_table_html, int_plot_html and sigtest_table_html all fell back to the independent variable’s factor levels – even for descend_indep, which is not a sort key at all. Ordering by ".count", ".count_per_indep_group", ".mean" or ".median" now works there, and matches the categorical path for every key whose meaning does not depend on the type of the dependent variable. The keys that need response categories (".top", ".bottom", ".upper", ".lower", ".mid_upper", ".mid_lower", ".sum_value", and a vector of category labels) now raise an error naming the offending key and the supported alternatives, instead of being accepted and discarded. Code that passed one of those keys with a numeric dependent variable will now stop rather than silently ignore it (#608)
  • Reordering the categories of an independent variable no longer drops its variable label. factor() returns a value carrying only levels and class, so the naive reorder discarded the label attribute that the plot titles read – the same attribute loss behind #603. New internal relevel_preserving_attributes() copies back everything factor() does not set itself; it also fixes the same latent loss in the sigtest_table_* ordering added in #605 (#608)
  • sigtest_table_* no longer emits Unknown or uninitialised column: `x` warnings when called without an indep. With no independent variable tidyr::expand_grid() produces no x column at all, and $ warns once per access for a column a tibble does not have, where [[ returns NULL silently. Both call sites already handled NULL correctly, so the output was never affected – but the noise scaled with the number of dependent variables, two warnings apiece (#609)
  • sigtest_table_* now orders the categories of the independent variable the way every other content type does, and respects sort_indep_by and descend_indep. Previously its per-category columns came out in order of appearance in the data and sort_indep_by was ignored entirely – not even its documented default ".factor_order" had any effect – so the same variable produced a different column order depending on how the input rows happened to be arranged, and merely introducing an NA could reshuffle the table. simple_descriptives() summarizes with .by, which groups in order of first appearance, and nothing re-sorted the result before the wide pivot took its column order from it. The order now comes from the same .indep_order that add_indep_order() computes for the other content types, so an ordered factor still takes precedence over sort_indep_by, an NA category still sorts last, and the long-format fallback is ordered on the same basis. Numeric dependent variables initially still fell back to the factor’s own levels here; that was lifted in #608, above. This changes the column order of existing sigtest_table_* output, which cannot be avoided while fixing the bug – the previous order was whatever .by happened to emit rather than a deliberate layout (#605)
  • sigtest_table_html no longer aborts with Element `<indep>` doesn't exist when the independent variable contains NA. simple_descriptives() silently dropped the grouping variable once it had more than five distinct values, and unique() counted NA as one of them, so an indep with exactly five observed categories plus any missing value tripped that limit. The drop happened inside a loop and was invisible to the wide pivot that then asked for the column by name, which is why the abort was identical for every showNA setting. The limit is gone (see below), so the grouping survives however many missing values indep has. showNA still decides whether the NA group gets columns of its own (#603)
  • The undocumented five-category limit on the independent variable has been removed, so sigtest_table_html, int_table_html and int_plot_html now honour an indep with any number of categories. Previously a six-category indep broke all three even with no NA present: the table types aborted and the plot failed at draw time, because the descriptives were silently computed without the grouping (#603)
  • sigtest_table_* now respects n_categories_limit (default 12), falling back to a long-format table when the independent variable has more categories than that, instead of adding a set of columns per category without limit. make_content.sigtest_table_html() also renames its Var 1/Var 2 columns before attaching the descriptives, so variables actually named x or y are no longer mangled into x...2/x...6 (#603)
  • sort_dep_by with a character vector of two or more category labels no longer sorts in the opposite direction to descend. calculate_sum_value_order() negated the flag, so a multi-label sort ordered ascending under the default descend = TRUE while the single-label form ordered descending. This changes the output order for anyone currently passing a multi-element sort_dep_by (#599)
  • sort_indep_by now errors on a key it cannot honor instead of silently returning unsorted output. Previously any unrecognized value — including a simple typo such as ".coutn" — was quietly ignored, and any .count-prefixed value was treated as .count. Removed the .count_total_indep key, which was whitelisted but never computed and so could only ever error (#600)
  • Corrected the documented basis for a character-vector sort_dep_by: a single label sorts by .count, while several labels sort by summed proportions (or counts when data_label = "count"). The 1.6.3 documentation described both as count-based (#493)
  • cat_plot_html now groups hover highlighting by category: hovering any bar highlights that category across every dependent variable, and hovering a legend key highlights its bars. Previously data_id was a per-row sequence, so hovering a bar highlighted only that bar and hovering a legend key highlighted nothing, because the legend’s data_id (the category) never matched the bars’ (a row number). Tooltips remain per bar (#458)
  • Documented the .range, .count, .proportion, .mean, .median and .sum_value keys for sort_dep_by, and the .factor_order, .variable_label, .count, .count_per_indep_group, .mean, .median and .sum_value keys for sort_indep_by, none of which were listed in ?makeme. Corrected the documented default of descend, which is TRUE rather than FALSE (#493)
  • ggiraph is now required at >= 0.9.2, the version that fixed the upstream “Failed setting attribute ‘data-id’/‘onclick’, mismatched lengths of ids and values” warnings when plot data contain NA (#457)
  • get_dep_label_prefix() now returns "" when the dep_label_prefix attribute is NA_character_ or has more than one element, as its documentation promises. Previously it returned NA in that case, because nzchar(NA) is TRUE (#585)

Documentation

  • devtools::document() no longer rewrites files no source change had touched. A title line left stranded above validate_sort_indep_by() when it was added in #600 meant validate_sort_column()’s block had no title of its own, so roxygen promoted its description into a four-line \title{}. Reattaching the line restores the title, and the two .Rd files that had simply never been resynced – man/validate_sort_indep_by.Rd, never generated, and man/summarize_cat_cat_data.Rd, still carrying the sort_dep_by wording #601 replaced – are now in step with their sources (#606)
  • _pkgdown.yml now has an articles: section, grouping the vignettes into “Using saros” and “Background” so they appear in the site navigation. The group description cross-links to saros.base, which covers project setup, drafting the report structure and rendering (#334)
  • New vignette("sorting") documents every supported sort_dep_by and sort_indep_by key grouped by family, the precedence of ordered factors, the descend/descend_indep defaults, the validation errors, and setting a sort order once via global_settings_set() (#493)

Internal Improvements

  • Documented, at all four call sites and with tests, that crosstable() computes .mean and .median over the factor level codes of ordinal scales rather than over the category labels. This is deliberate – saros summarizes ordinal survey scales whose categories are text – and had previously been mistaken for a bug (#577)

saros 1.6.2

CRAN release: 2026-04-29

Breaking Changes

  • Removed deprecated embed_* functions: embed_cat_prop_plot(), embed_cat_table(), and embed_chr_table_html() have been removed. These were soft-deprecated since v1.1.0. Use makeme() instead (e.g., makeme(type = "cat_prop_plot_html"), makeme(type = "cat_table_html"), makeme(type = "chr_table_html")).
  • cat_plot_docx now uses girafe global settings for colors: The colour_palette parameter has been removed from cat_plot_docx. Instead, colors are now controlled exclusively through global_settings_set(fn_name = "girafe") for consistency with HTML plots. This enables unified color management across all output formats (HTML and DOCX). Checkbox plot support (checked, not_checked, colour_2nd_binary_cat) is now also available for DOCX plots, with automatic legend hiding and label suppression for the unchecked category. Users should migrate from makeme(..., colour_palette = c(...)) to global_settings_set(fn_name = "girafe", new = list(palette_codes = list(c(...)))).

New Features

  • New sort_dep_by = ".range" orders dependent variables by the spread (max - min) of their category proportions, i.e. by how unevenly the answers are distributed. Variables where one category dominates sort first with the default descend = TRUE (#494)
  • New sort_indep_by = ".count_per_indep_group" orders the categories of the independent variable by the total number of valid responses in each group, so groups can be ordered by size rather than by response pattern (#492)
  • crowd_plots_as_tabset() and crowd_tables_as_tabset() now insert Quarto {{< pagebreak >}} shortcodes between items when rendering to paginated formats (docx, typst, PDF). HTML-based formats (including revealjs and slidy) are detected via knitr::is_html_output() and are never page-broken. A new pagebreak parameter ("auto", "always", "never") controls this behaviour
  • Added check_quarto_website_index() function to detect folders in a Quarto website project that contain .qmd files but are missing an index.qmd. Missing index files often cause broken navigation menus. Issues a cli warning listing the offending folders.
  • Added quarto_pdf_post_render() function for use as a Quarto post-render script. For each rendered PDF, it checks for a matching DOCX file, extracts the document title from the DOCX metadata, sets it as the PDF metadata title (via Ghostscript), and updates the link text in the corresponding index.html. Defaults to reading output files from the QUARTO_PROJECT_OUTPUT_FILES environment variable set by Quarto during project render.
  • Added make_file_links() function for dynamically creating markdown lists with links to files. Extracts document titles from DOCX, PPTX, and PDF file metadata and generates formatted markdown lists. Ideal for creating navigation links in Quarto/RMarkdown documents that point to generated reports in a folder. Supports glob patterns, recursive search, and customizable list formatting (unordered or numbered). It appends a file extension suffix to link labels when multiple file types are present for the same base name, making it clear which format each link points to.
  • Enhanced ggsaver() to automatically apply colour palettes from girafe() global settings when saving plots. This ensures saved PNG/PDF images match the appearance of interactive plots displayed with girafe(). Palette settings can be configured via global_settings_set(fn_name = "girafe", new = list(palette_codes = ...)) and will be automatically applied when saving plots through get_fig_title_suffix_from_ggplot() or direct ggsaver() calls
  • Added folder and file_prefix parameters to get_fig_title_suffix_from_ggplot() for controlling where files are saved and what prefix to use for filenames
  • Enhanced get_fig_title_suffix_from_ggplot() to support global settings inheritance via global_settings_set(), consistent with other saros functions like make_link() and makeme()
  • Unified DOCX plot types: Merged cat_prop_plot_docx and cat_freq_plot_docx into a single cat_plot_docx type, bringing it in line with the cat_plot_html API. The freq parameter now controls whether to create stacked proportion/percentage plots (freq=FALSE, default) or dodged frequency plots (freq=TRUE)
  • Added DOCX table types: New cat_table_docx and chr_table_docx output types for creating Word document tables. These types use officer::body_add_table() to embed tables in Word documents. Like HTML table types, they return data.frames when docx_return_object=TRUE, enabling flexible table composition
  • Added docx_return_object parameter to makeme() to control return type for DOCX outputs. When TRUE, returns the underlying object (mschart for plots, data.frame for tables) instead of embedding it in an rdocx document, enabling more flexible composition of Word documents
  • Refactored fig_height_h_barchart2() to S3 generic: Now supports both ggplot2 objects (from type="cat_plot_html") and mschart objects (from type="cat_plot_docx", docx_return_object=TRUE). This enables automatic height calculation for Word charts, making it easier to size charts consistently across output formats
  • Refactored n_range2() to S3 generic: Now supports both ggplot2 objects and mschart objects, similar to fig_height_h_barchart2(). This enables consistent sample size reporting across both HTML and Word chart outputs, making it easier to annotate charts with N ranges regardless of output format

Bug Fixes

  • Updated make_link() tests to use dynamic rlang::hash() values instead of hardcoded hashes, preventing fragile failures when hash representations change across environments or versions (#587)
  • crowd_plots_as_tabset() now gives an informative error when passed table output (e.g. from type = "cat_table_html") instead of plot output, directing users to crowd_tables_as_tabset() (#515)
  • txt_from_cat_mesos_plots() now gives an informative error when passed table output instead of plot output, instead of failing with a cryptic .category_order column-not-found error (#515)
  • Fixed girafe() to return a static ggplot object instead of a girafe object when rendering in non-HTML knitr documents (e.g. PDF, Word). Previously the interactive widget was returned unconditionally, causing rendering failures in non-HTML output formats (#551)
  • Fixed cat_plot_html data labels being left-aligned instead of centered. The hjust value for geom_label was corrected from 0 to 0.5 (#553)
  • Fixed txt_from_cat_mesos_plots() for checkbox variables to compare on the checked category (or the first non-NA category as fallback) rather than always using the first category. This ensures the correct proportion is highlighted when the variable uses checked/not_checked encoding (#556)
  • Fixed txt_from_cat_mesos_plots() color legend inconsistency across mesos groups. Category color assignment now only computes full factor levels for factor/ordered variables, preventing spurious extra colors from appearing in legends for non-factor variables (#552, #555)
  • Fixed txt_from_cat_mesos_plots() showing zero proportions due to .variable_label_original being overwritten by the N-suffix mutation in add_n_to_label() before it could be used for joining. The original column is now preserved before any label mutation (#554)
  • Fixed int_plot_html to always hide the fill legend (previously shown for single dep without indep), and to correctly respect hide_axis_text_if_single_variable (previously ignored for int_plot_html, only applied to cat_plot_html) (#557)
  • Fixed cat_plot_docx percentage plots to show consistent axis breaks at 0%, 25%, 50%, 75%, and 100% by setting axis limits (0-1) and major unit (0.25; experimental) for the y-axis. This improves readability and consistency across Word document charts
  • Fixed default font sizes for cat_plot_docx: increased label_font_size and main_font_size defaults from 6 to 9 for better readability in Word documents
  • Fixed hide_axis_text_if_single_variable parameter not being respected in cat_plot_docx output. The function now properly hides axis labels for single-variable plots when this parameter is TRUE, matching the behavior of cat_plot_html
  • Fixed colour_palette parameter not being applied in cat_plot_docx output. The mschart library requires colour palettes to be named vectors where names match category levels, and the length must match the number of categories. The function now: (1) names the colour palette vector with category levels, (2) expands the palette with generated colours if user provides fewer colours than categories, and (3) trims the palette if user provides more colours than needed
  • Fixed set_pdf_metadata_title() corrupting non-ASCII characters (e.g. æøå) in PDF metadata titles. The pdfmark title is now encoded as a UTF-16BE hex string with BOM instead of a plain PostScript literal, avoiding locale/codepage-dependent byte interpretation by Ghostscript
  • Fixed fig_height_h_barchart2() where hide_axis_text_if_single_variable=TRUE was paradoxically giving larger heights than FALSE. Now correctly detects when axis text has been hidden (via .variable_label_original column) and applies a reduction factor (default 0.6 via multiplier_hide_axis_single_var parameter) plus reduced minimum height, resulting in appropriately smaller plots when axis text is hidden
  • Fixed fig_height_h_barchart2() for int_plot_html plots: previously always returned max (12) regardless of plot complexity, and errored with “only supports a single indep variable” when an indep variable was present (because .value was falsely detected as a second indep column). Height now scales properly with n_y and n_cats_x via fig_height_h_barchart() with n_cats_y = 1 and n_legend_lines = 0
  • Fixed n_range2() for int_plot_html plots to report N range per dependent variable instead of total count across all variables. Now correctly calculates sample size separately for each variable and reports the range (e.g., [250-299] when variables have different amounts of missing data)
  • Fixed guess_legend_ncols() in girafe() to properly handle fill aesthetics using expressions like fill = factor(cyl). The function now uses get_fill_levels() to evaluate expressions in data context instead of direct column access, preventing “no non-missing arguments to max; returning -Inf” warnings
  • makeme() now gives an informative error message when the requested output type is incompatible with the dependent variable types (e.g., using type = "cat_table_html" with numeric variables, or type = "int_plot_html" with factor variables). Previously this produced a cryptic error about setting an attribute on NULL.

Internal Improvements

  • Optimized fig_height_h_barchart2() ggplot height estimation: The function now extracts information directly from the ggplot object for more accurate height calculations:
    • Reads the actual font size from the ggplot theme (base_size) instead of using a fixed default, so heights scale correctly when users change the global ggplot2 theme (e.g., theme_gray(base_size = 14))
    • Detects legend position from the theme — when the legend is at the sides ("right", "left") or hidden ("none"), no vertical space is allocated for it, producing more compact figures
    • Simulates actual text wrapping (via count_max_wrapped_lines()) to count the true number of lines labels wrap to, instead of estimating from character counts
  • Fixed fig_height_h_barchart() strip angle condition to use abs(strip_angle), so negative angles (e.g., -90° from default ggplot2 strip themes) are handled identically to their positive counterparts
  • Extracted shared color resolution logic into resolve_category_colors() helper, removing duplication across make_content.cat_plot_html(), make_content.cat_plot_docx(), and related functions (#548)
  • Major refactoring of validation infrastructure (implements refactoring opportunities #1 and #4):
  • Added is_int_plot_html() helper function to centralize detection logic for int_plot_html data structures, improving code maintainability and consistency across fig_height_h_barchart2() and n_rng2()

saros 1.6.1

CRAN release: 2026-01-28

New Features

  • Added quiet parameter to global_settings_reset() to optionally suppress informational messages when resetting global settings to package defaults
  • Addressed issue #510: makeme() now defaults to type = "auto" which intelligently detects the appropriate output type based on dependent variable classes:
    • Numeric variables -> int_plot_html
    • Single character variable -> chr_table_html
    • Factor/ordered or multiple character variables -> cat_plot_html
    • Unsupported types (Date, POSIXct, POSIXt, list, complex) produce clear error messages identifying the problematic variables
    • This eliminates the uninformative “arguments must have same length” error when accidentally providing numeric variables without specifying type. Mixed variable types produce a clear error message suggesting the correct type to use

Bug Fixes

  • Fixed issue #518 where crowd_plots_as_tabset() with save = NULL produced cryptic “object ‘caption’ not found” error. Added proper validation to ensure save parameter is a single logical value (TRUE or FALSE)
  • Fixed txt_from_cat_mesos_plots() where second group (others) proportions incorrectly became zero. Refactored to process each variable separately, ensuring both groups’ proportions are correctly calculated per variable
  • Fixed txt_from_cat_mesos_plots() where n_highest_categories=2 with binary (2-category) variables summed all categories to 1.0, producing uninformative results. Now only applies n_highest_categories when the variable has more categories than the threshold, otherwise uses only the single highest/lowest category
  • Fixed issue #511 where x_axis_label_width parameter had no effect in int_plot_html when no independent variable was present. The apply_label_wrapping() function now correctly wraps .variable_label when indep_length == 0
  • Fixed issue #512 where makeme() with multiple crowds produced identical plots instead of crowd-specific filtered data. The process_crowd_data() function now correctly passes filtered subset_data to make_content() for each crowd, ensuring each plot displays statistics computed from only that crowd’s data subset
  • Fixed txt_from_cat_mesos_plots() to handle cases where .category_order contains NA values by using na.rm = TRUE when calculating max values, preventing “NA/NaN argument” errors
  • Fixed n_rng2() to correctly calculate sample sizes for int_plot_html plots by only checking complete cases on relevant variables (.value and independent variables) instead of all columns in the dataset. Also modified make_content.int_plot_html() to only include necessary columns in the plot object, reducing memory footprint

saros 1.6.0

CRAN release: 2025-11-10

Breaking Changes

  • makeme() returns an empty data.frame instead of NULL when no plot or table can be created, simplifying downstream code (e.g. gt::gt() fails if served NULL)
  • Resolved issue #372 - descend parameter now works correctly with ordered factors while preserving their inherent level ordering. Ordered factors maintain their natural order as the base, but descend can reverse the display order
  • Enhanced custom_palette() to allow priority_palette_codes to supplement base palette when insufficient colors are available
  • Improved color palette handling for explicit NA factor levels when using showNA = "always"

New Features

New Functions and Output Types

  • New output type: makeme(type = "int_plot_html") for interactive interval plots with violin and box plots
  • New function: txt_from_cat_mesos_plots() to generate textual summaries from two categorical mesos-scale plots, highlighting significant differences in selected categories between groups. Supports global settings via global_settings_set() (closes #506)
  • New function: crowd_plots_as_tabset() to convert a list of ggplot2 objects (typically from makeme(crowd = ...)) into Quarto tabsets with automatic height calculation and optional download links. Supports both categorical and interval plots with intelligent auto-detection based on plot layers
  • New exported function: get_fig_title_suffix_from_ggplot() generates figure title suffixes with N range and optional download links for plots

Enhanced Functionality

  • Added support for data_label = "mean" and data_label = "median" in makeme() for type = "cat_*_html" outputs (addresses issue #460)
  • Added data_label_position argument to makeme() allowing data labels to be positioned at “center”, “bottom”, “top”, or “above” bars in categorical plots (addresses issue #365)
  • Enhanced chr_table_html to support multiple independent variables for displaying background context with open-ended text responses
  • Added na_colour parameter to hex_bw() function to allow customization of text color for NA fills (default: “#ffffff”)
  • Added colour_2nd_binary_cat parameter to girafe() for checkbox plots - when set with checked/not_checked, reverses category order so the second category receives the specified color

Sorting Improvements

  • Independent-variable ordering is now computed per dependent variable, allowing indep order to vary per dep; descend_indep now consistently reverses indep order across tables and plots; plots use centralized .indep_order when indep is on the x-axis; ordered indep factors take precedence over sort_indep_by (reversed only when descend_indep=TRUE); legends preserve unused response levels in .category
  • Implemented B1 strategy for direct column-based sorting via whitelists. Allowed keys for dependent variables are now centrally defined and enforced; independent variables use a similar whitelist (including .count_total_indep). This prevents accidental sorting on arbitrary or missing columns and clarifies supported behavior
  • sort_indep_by now explicitly defaults to ".factor_order" and accepts NULL (treated as ".factor_order"). When no independent variable is provided (indep = NULL), specifying sort_indep_by or descend_indep no longer errors; they are simply ignored
  • Improved sorting stability for dependent variables with missing/duplicate labels — internal joins for computing .dep_order now key by .variable_name (unique) instead of .variable_label, preventing many-to-one join errors in edge cases while preserving displayed labels

Bug Fixes & Improvements

Critical Fixes

  • CRITICAL: Resolved bug in makeme() where combinations of valid factor variables with all-NA factor variables incorrectly threw “mix of categorical and continuous variables” error. Variable type checking now uses filtered variable lists instead of original lists, preventing premature type validation errors
  • Resolved issue #464 - makeme() failures for sigtest_table when dep and indep variables overlap. Now automatically excludes indep variables from dep selection to prevent conflicts

Robustness Improvements

  • Added vector length validation in get_fig_title_suffix_from_ggplot() to prevent subscript-out-of-bounds errors when vectorized parameters have mismatched lengths
  • n_rng2() now gracefully handles plots not created by makeme() by calculating N from complete cases instead of aborting, and properly handles all-NA and empty .count_per_indep_group values by returning “0” with clear warnings instead of producing infinite values
  • crowd_plots_as_tabset() now validates each plot individually in the loop, preventing invalid objects from causing failures
  • Improved empty data frame handling throughout - using is.data.frame() and nrow() checks instead of length() for more reliable validation

Other Fixes

  • Resolved faceting issue in int_plot_html where label_separator = NULL with independent variables caused violin/boxplot and label geoms to appear in separate facets due to inconsistent string wrapping
  • Removed unnecessary “multiple main questions” warning when using label_separator = NULL, as having different main questions is expected behavior
  • Corrected double NA check logic in check_bool() function - removed redundant condition that made validation always pass for NA values
  • Improved NULL and NA handling in glue_together_range() to prevent edge case failures with empty or invalid data ranges
  • Improved robustness of check_no_duplicated_label_suffix() to handle empty data frames and missing columns gracefully
  • Enhanced check_sort_by() validation to properly handle empty character vectors with clear error messages
  • Improved keep_subitem() to handle character inputs and use factor levels for better NA handling
  • Simplified arrange_table_data() sorting logic for better reliability
  • Updated documentation reference from ggplot2::theme_set() to ggplot2::set_theme() due to ggplot2 4.0.0
  • Fixed custom_palette() in girafe() to properly handle unnamed elements in priority_palette_codes as colors for “NA” category. Previously, unnamed elements were filtered out, causing NA categories to receive no color assignment (appearing as white fill with white text)

Performance Enhancements

  • Optimized makeme() examples for 73.8% faster execution (6.6s → 1.7s total). Reduced variable counts and crowd configurations while maintaining educational value
  • Updated fig_height_h_barchart2() example for consistency with optimized examples
  • Completely rewrote the .spread algorithm in subset_vector() for better spread maximization using evenly spaced positions

Internal Refactoring

  • Substantially modularized internal implementation of makeme() into focused helper functions (argument setup, crowd processing, output assembly, validation). Improves readability, testability, and robustness without changing public API (closes #368)
  • Split post_process_makeme_data() into focused single-responsibility functions: process_indep_factor_levels() for general factor reversal and process_binary_category_colors() for cat_plot_html-specific binary category processing
  • Moved process_binary_category_colors() logic from make_content.cat_plot_html() to girafe(), consolidating all color-related logic in one place
  • Refactored checkbox plot handling in girafe() to integrate colour_2nd_binary_cat parameter with convert_to_checkbox_plot() function
  • Modularized tabular I/O functionality - renamed pretty_tabular.R to tabular_write.R and extracted tabular_read() function into separate file
  • Centralized global constants (sorting whitelists) in zzz.R under .saros.env for easier maintenance
  • Extracted duplicate label wrapping logic into apply_label_wrapping() helper function, improving maintainability and consistency
  • Added explicit return statement in make_content.int_plot_html() for clarity
  • Added .onUnload() function to clean up global options when package is unloaded, preventing option pollution in user’s R session
  • Using air for consistent code formatting
  • CRAN Compliance: Reduced string lengths in documentation for girafe() and makeme() functions to meet CRAN’s character limit per line requirement

Development & Testing

  • Added comprehensive test coverage for makeme() helper functions with full roxygen2 documentation and @keywords internal annotation for internal API clarity
  • Added comprehensive visual regression testing for int_plot_html using vdiffr snapshot tests covering various scenarios
  • Added comprehensive test coverage for utility validation functions and edge cases including all-NA variables
  • Added test coverage for global settings support in txt_from_cat_mesos_plots() with proper cleanup using withr::defer()
  • Added VS Code configuration for improved development experience
  • Added survey package to Suggests for enhanced testing capabilities
  • Updated build ignore patterns for coverage reports and library files

saros 1.5.4

CRAN release: 2025-06-04

  • Fix: Corrected error introduced in 1.5.3

saros 1.5.3

CRAN release: 2025-06-02

  • Fix: makeme now handles arguments in parent frame scopes correctly.
  • Fix: internal function get_common_levels now works with no provided col_pos.

saros 1.5.1

CRAN release: 2025-02-12

  • Feature: Added ".percentage" as valid (sorting) column
  • Feature: cat_table_html returns NULL if nothing to display
  • Fix: scale_x_reordered now only sorts when needed
  • Fix: cat_table_html takes showNA properly
  • Minor: refactoring of cat_plot_html

saros 1.5.0

CRAN release: 2025-01-10

Major changes

Minor changes

  • makeme(type="cat_plot_html") no longer shows a line one the y axis for single variable plots.
  • Refactored crosstable.data.frame() and crosstable.survey() methods.
  • Many more tests.
  • Countless bugfixes.

saros 1.2.0

CRAN release: 2024-09-03

Major changes

  • embed_*-functions are replaced by makeme(type="cat_plot") etc
    • makeme() takes S3-methods which eases expansions.
    • embed_* are thus lifecycle soft-deprecated.

New features

  • n_range() gives the n_range for a given dataset, dependent and independent variables.
  • n_range2() same as n_range() but takes a makeme()-object for convenience.
  • make_link() for generating downloadable figures, tables, data or anything else, on the spot.
  • ggsaver() is a minor wrapper to ease using make_link with ggplot2::ggsave().
  • fig_height_h_barchart() estimates the optimal figure height for a horizontal barchart.
  • fig_height_h_barchart2() same as above, but takes a makeme()-object for convenience.
  • makeme(type="cat_plot_html") allows sorting within each dependent variable-by-independent variable (facet-sort)

Bugfixes

  • Too many to list, but see saros 1.1.0 for some of them.

saros 1.1.0

-feat: Removed colour_palette (#328) -fix: Argument chapter_qmd_start_section_filepath now has effect. (#321) -fix: simplified create_email_credentials() (#305) -fix: pkgdown for recode_checkbox_sets (#304) -fix: cat_*_plot now displays keys for unused categories in legend (#301) -fix: single_y_bivariates_if_deps_above() no longer affects univariates (#300) -fix: More robust estimate_plot_height if dep only has one NA category (#299) -fix: Significance test now works in edge cases (#297) -feat: chr_table now ignores NA and empty strings. (#296) -fix: serialized_format now actually supports {qs}, if installed. (#293) -feat: Added default to replace_heading_for_group (#291) -feat: Removed flexi-app (#289) -feat: Removed unnecessary rendering-assistance tools. (#287) -feat: gen_qmd_index has now been refactored (#286) - simplified to gen_qmd_file, which better handles index and report - Also allows separate qmd_snippets at start and end for index and - Extract formats from report_header_yaml which is used to create links -fix: insert_obj_in_qmd now uses conv_to_valid_obj_name() again (#284) -feat: Removed saving png files as it is rarely used. (#283) -fix: crosstable3() now handles character vectors. (#278)

saros 1.0.5

saros 1.0.3

  • Added more arguments for plot text sizes, with more useful defaults for Word and HTML layouts.
  • attach_qualtrics_labels is now more flexible.
  • Minor fix in sanitize_labels.
  • Internal change to accommodate ggplot2 3.5.0.
  • Improved performance for argument validation checks.
  • setup_access_restrictions now accepts NULL password input.
  • setup_access_restrictions now can warn instead of error if rel_parent_path does not exist.
  • sort_by now correctly sorts with descend=TRUE for “.upper”, etc.
  • Fixed list_available_element_types
  • Set one long-running test for draft_report to only run on maintainer’s local computer.
  • sanitize_labels now has option to translate ASCII HTML-escaped characters to unicode.

saros 1.0.1

CRAN release: 2024-01-26

  • Minor fixes for CRAN manual review

saros 1.0.0

  • Submitted to CRAN

saros 0.9.1

  • First version ready