Changelog
Source:NEWS.md
saros 1.6.1.9000 (dev)
New Features
- 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) - Enhanced
ggsaver()to automatically apply colour palettes fromgirafe()global settings when saving plots. This ensures saved PNG/PDF images match the appearance of interactive plots displayed withgirafe(). Palette settings can be configured viaglobal_settings_set(fn_name = "girafe", new = list(palette_codes = ...))and will be automatically applied when saving plots throughget_fig_title_suffix_from_ggplot()or directggsaver()calls - Added
folderandfile_prefixparameters toget_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 viaglobal_settings_set(), consistent with other saros functions likemake_link()andmakeme() -
Unified DOCX plot types: Merged
cat_prop_plot_docxandcat_freq_plot_docxinto a singlecat_plot_docxtype, bringing it in line with thecat_plot_htmlAPI. Thefreqparameter now controls whether to create stacked proportion/percentage plots (freq=FALSE, default) or dodged frequency plots (freq=TRUE) - Added
docx_return_as_mschartparameter tomakeme()to control return type forcat_plot_docx. WhenTRUE, returns the mschart object directly instead of embedding it in an rdocx document, enabling more flexible composition of Word documents
Bug Fixes
- Fixed
colour_paletteparameter not being applied incat_plot_docxoutput. 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
fig_height_h_barchart2()wherehide_axis_text_if_single_variable=TRUEwas paradoxically giving larger heights thanFALSE. Now correctly detects when axis text has been hidden (via.variable_label_originalcolumn) and applies a reduction factor (default 0.6 viamultiplier_hide_axis_single_varparameter) plus reduced minimum height, resulting in appropriately smaller plots when axis text is hidden - Fixed
fig_height_h_barchart2()to properly handleint_plot_htmlplots with independent variables. The function now forwards tofig_height_h_barchart()with appropriate parameters for interval plots, returning themaxparameter value (default 12) while allowing user customization, instead of erroring with “only supports a single indep variable” - Fixed
n_range2()forint_plot_htmlplots 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()ingirafe()to properly handle fill aesthetics using expressions likefill = factor(cyl). The function now usesget_fill_levels()to evaluate expressions in data context instead of direct column access, preventing “no non-missing arguments to max; returning -Inf” warnings
Internal Improvements
-
Major refactoring of validation infrastructure (implements refactoring opportunities #1 and #4):
- All validation functions now use consistent
validate_*prefix for better discoverability via auto-complete (e.g.,validate_bool(),validate_integerish(),validate_double(),validate_string()) - Added
validate_params()helper function that consolidates multiple parameter validations into a single declarative call, reducing code duplication from 30+ lines to ~5 lines infig_height_h_barchart() - Created validation rule builders (
validate_integerish_rule(),validate_double_rule(),validate_bool_rule(),validate_string_rule()) for more expressive and maintainable validation specifications invalidate_makeme_options() - Maintained backwards compatibility with
check_*aliases for existing code - Improved code maintainability and readability across validation-heavy functions
- All validation functions now use consistent
- Added
is_int_plot_html()helper function to centralize detection logic for int_plot_html data structures, improving code maintainability and consistency acrossfig_height_h_barchart2()andn_rng2()
saros 1.6.1
CRAN release: 2026-01-28
New Features
- Added
quietparameter toglobal_settings_reset()to optionally suppress informational messages when resetting global settings to package defaults -
Addressed issue #510:
makeme()now defaults totype = "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
- Numeric variables ->
Bug Fixes
- Fixed issue #518 where
crowd_plots_as_tabset()withsave = NULLproduced cryptic “object ‘caption’ not found” error. Added proper validation to ensuresaveparameter 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()wheren_highest_categories=2with binary (2-category) variables summed all categories to 1.0, producing uninformative results. Now only appliesn_highest_categorieswhen the variable has more categories than the threshold, otherwise uses only the single highest/lowest category - Fixed issue #511 where
x_axis_label_widthparameter had no effect inint_plot_htmlwhen no independent variable was present. Theapply_label_wrapping()function now correctly wraps.variable_labelwhenindep_length == 0 - Fixed issue #512 where
makeme()with multiple crowds produced identical plots instead of crowd-specific filtered data. Theprocess_crowd_data()function now correctly passes filteredsubset_datatomake_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_ordercontains NA values by usingna.rm = TRUEwhen calculating max values, preventing “NA/NaN argument” errors - Fixed
n_rng2()to correctly calculate sample sizes forint_plot_htmlplots by only checking complete cases on relevant variables (.valueand independent variables) instead of all columns in the dataset. Also modifiedmake_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 ofNULLwhen no plot or table can be created, simplifying downstream code (e.g.gt::gt()fails if servedNULL) - Resolved issue #372 -
descendparameter now works correctly with ordered factors while preserving their inherent level ordering. Ordered factors maintain their natural order as the base, butdescendcan reverse the display order - Enhanced
custom_palette()to allowpriority_palette_codesto 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 viaglobal_settings_set()(closes #506) -
New function:
crowd_plots_as_tabset()to convert a list of ggplot2 objects (typically frommakeme(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"anddata_label = "median"inmakeme()fortype = "cat_*_html"outputs (addresses issue #460) - Added
data_label_positionargument tomakeme()allowing data labels to be positioned at “center”, “bottom”, “top”, or “above” bars in categorical plots (addresses issue #365) - Enhanced
chr_table_htmlto support multiple independent variables for displaying background context with open-ended text responses - Added
na_colourparameter tohex_bw()function to allow customization of text color for NA fills (default: “#ffffff”) - Added
colour_2nd_binary_catparameter togirafe()for checkbox plots - when set withchecked/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_indepnow consistently reverses indep order across tables and plots; plots use centralized.indep_orderwhen indep is on the x-axis; ordered indep factors take precedence oversort_indep_by(reversed only whendescend_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_bynow explicitly defaults to".factor_order"and acceptsNULL(treated as".factor_order"). When no independent variable is provided (indep = NULL), specifyingsort_indep_byordescend_indepno longer errors; they are simply ignored - Improved sorting stability for dependent variables with missing/duplicate labels — internal joins for computing
.dep_ordernow 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 bymakeme()by calculating N from complete cases instead of aborting, and properly handles all-NA and empty.count_per_indep_groupvalues 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()andnrow()checks instead oflength()for more reliable validation
Other Fixes
- Resolved faceting issue in
int_plot_htmlwherelabel_separator = NULLwith 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()toggplot2::set_theme()due to ggplot2 4.0.0 - Fixed
custom_palette()ingirafe()to properly handle unnamed elements inpriority_palette_codesas 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
.spreadalgorithm insubset_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 andprocess_binary_category_colors()for cat_plot_html-specific binary category processing - Moved
process_binary_category_colors()logic frommake_content.cat_plot_html()togirafe(), consolidating all color-related logic in one place - Refactored checkbox plot handling in
girafe()to integratecolour_2nd_binary_catparameter withconvert_to_checkbox_plot()function - Modularized tabular I/O functionality - renamed
pretty_tabular.Rtotabular_write.Rand extractedtabular_read()function into separate file - Centralized global constants (sorting whitelists) in
zzz.Runder.saros.envfor 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
airfor consistent code formatting -
CRAN Compliance: Reduced string lengths in documentation for
girafe()andmakeme()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_htmlusing 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 usingwithr::defer() - Added VS Code configuration for improved development experience
- Added
surveypackage to Suggests for enhanced testing capabilities - Updated build ignore patterns for coverage reports and library files
saros 1.5.3
CRAN release: 2025-06-02
- Fix:
makemenow handles arguments in parent frame scopes correctly. - Fix: internal function
get_common_levelsnow works with no providedcol_pos.
saros 1.5.1
CRAN release: 2025-02-12
- Feature: Added
".percentage"as valid (sorting) column - Feature:
cat_table_htmlreturns NULL if nothing to display - Fix:
scale_x_reorderednow only sorts when needed - Fix:
cat_table_htmltakes showNA properly - Minor: refactoring of
cat_plot_html
saros 1.5.0
CRAN release: 2025-01-10
Major changes
- Lots of settings for
makeme()useful for creating plots comparing a group with all other groups combined, or everyone. -
fig_height_h_barchart()finally works adequately for 90 percent of figure combinations. - Global settings inheritance for
makeme(),make_link(),girafe(),n_range(),n_range2() - New function
makeme(type="int_plot_html")for violin plots
saros 1.2.0
CRAN release: 2024-09-03
Major changes
-
embed_*-functions are replaced bymakeme(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 asn_range()but takes amakeme()-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)
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.3
- Added more arguments for plot text sizes, with more useful defaults for Word and HTML layouts.
-
attach_qualtrics_labelsis now more flexible. - Minor fix in
sanitize_labels. - Internal change to accommodate ggplot2 3.5.0.
- Improved performance for argument validation checks.
-
setup_access_restrictionsnow accepts NULL password input. -
setup_access_restrictionsnow can warn instead of error ifrel_parent_pathdoes not exist. -
sort_bynow correctly sorts withdescend=TRUEfor “.upper”, etc. - Fixed
list_available_element_types - Set one long-running test for
draft_reportto only run on maintainer’s local computer. -
sanitize_labelsnow has option to translate ASCII HTML-escaped characters to unicode.