spicy 0.6.0
New features
New family of association measure functions for contingency tables:
assoc_measures(),contingency_coef(),gamma_gk(),goodman_kruskal_tau(),kendall_tau_b(),kendall_tau_c(),lambda_gk(),phi(),somers_d(),uncertainty_coef(), andyule_q(). Each returns a numeric scalar by default; passdetail = TRUEfor a named vector with estimate, confidence interval, and p-value.cross_tab()gainsassoc_measureandassoc_ciarguments. When both variables are ordered factors, it automatically selects Kendall’s Tau-b instead of Cramer’s V. The note format changes fromChi-2: 18.0 (df = 4)toChi-2(4) = 18.0. Numeric attributes (chi2,df,p_value,assoc_measure,assoc_value,assoc_result) are now attached to the output data frame.table_apa()now dynamically labels the association measure column based on the measure used, instead of always showing “Cramer’s V”. Newassoc_measureandassoc_ciarguments are passed through tocross_tab().table_apa()gainsoutput = "gt"to produce agt_tblobject with APA-style formatting, column spanners, and alignment.table_apa()now correctly centers spanner labels over their column pairs intinytableandflextableoutput.All association measure functions and
assoc_measures()gain adigitsargument (default 3) that controls the number of decimal places when printed. The p-value always uses 3 decimal places or< 0.001.detail = TRUEresults now print with formatted output (aligned columns, fixed decimal places) via a newprint.spicy_assoc_detail()method.assoc_measures()output uses a newprint.spicy_assoc_table()method with the same formatting.New bundled dataset
sochealth: a simulated social-health survey (n = 1200, 24 variables) with variable labels, ordered factors, survey weights, and missing values. Includes four Likert-scaled life satisfaction items (life_sat_health,life_sat_work,life_sat_relationships,life_sat_standard) for demonstratingmean_n(),sum_n(), andcount_n().
Bug fixes
kendall_tau_c()is now consistently named “Kendall’s Tau-c” throughout the package (previously “Stuart’s Tau-c” in some places).cross_tab()rescale logic now operates on complete cases only, so the weighted total N matches the unweighted N when missing values are present (consistent with Stata behavior).mean_n(),sum_n(), andcount_n()no longer trigger a tidyselect deprecation warning whenselectreceives a character vector. Character vectors are now automatically wrapped withall_of().table_apa()p-values no longer wrap across lines intinytableHTML output.
Breaking changes
-
cramer_v()now accepts adetailargument. By default it returns a numeric scalar (as before). Passdetail = TRUEto get a 4-element named vector (estimate,ci_lower,ci_upper,p_value), ordetail = TRUE, conf_level = NULLfor a 2-element vector (estimate,p_value) without CI.
spicy 0.5.0
CRAN release: 2026-03-14
New features
- New
table_apa()helper to build APA-ready cross-tab reports with multiple output formats (wide,long,tinytable,flextable,excel,clipboard,word). -
table_apa()exposes keycross_tab()controls for weighting and inference (weights,rescale,correct,simulate_p,simulate_B) and now handles missing values explicitly whendrop_na = FALSE.
Bug fixes
-
count_n()no longer crashes whenspecial = "NaN"is used with non-numeric columns. Passingcount = NAnow errors with a message directing tospecial = "NA". -
cross_tab()fixes a spurious rescale warning for explicit all-ones weights and aligns the Cramer’s V formula withcramer_v(). -
table_apa()no longer leaks global options on error. Thesimulate_pdefault is aligned toFALSE. -
varlist()title generation no longer crashes on unrecognizable expressions.
Minor improvements
-
copy_clipboard()parametermessagerenamed toshow_message. -
freq()now dispatches printing correctly via S3. - Removed unused
collapseandstringifromImports.
spicy 0.4.2
CRAN release: 2026-03-06
-
cross_tab()hardening: improved vector-mode detection (including labelled vectors), stricter weight validation, safer rescaling, and clearer early errors (e.g., explicity = NULL). -
cross_tab()statistics are now computed on non-empty margins in grouped tables, avoiding spuriousNAresults; internal core path refactored to removedplyr/tibblefrom computation while preserving user-facing behavior. -
freq()now errors clearly whenxis missing for data.frame input and validates rescaling when weight sums are zero/non-finite. -
count_n(),mean_n(), andsum_n()regex mode is hardened (regex = TRUEnow validates/defaultsselectsafely). -
mean_n()andsum_n()now returnNA(with warning) when no numeric columns are selected. -
label_from_names()now validates input type (data.frame/tibble required). -
cramer_v()now returnsNAwith warning for degenerate tables. - Dependency optimization:
DTandcliprmoved toSuggests; optional runtime checks added incode_book()andcopy_clipboard(). - Tests expanded with regression coverage for all the above edge cases.
spicy 0.4.1
CRAN release: 2025-12-21
- Fixed CRAN incoming check notes by removing non-standard top-level files.
spicy 0.4.0
Print methods have been fully redesigned to produce clean, aligned ASCII tables inspired by Stata’s layout. The new implementation improves formatting, adds optional color support, and provides more consistent handling of totals and column spacing.
Output from
freq()andcross_tab()now benefits from the enhancedprint.spicy()formatting, offering clearer, more readable summary tables.Documentation and internal tests were updated for clarity and consistency.
cross_tab()gains an explicitcorrectargument to control the use of Yates’ continuity correction for Chi-squared tests in 2x2 tables. The default behavior remains unchanged.The documentation of
cross_tab()was refined and harmonized, with a clearer high-level description, improved parameter wording, and expanded examples.Minor cosmetic improvements were made to
varlist()output: the title prefix now usesvl:instead ofVARLIST, and the column nameNdist_valwas renamed toN_distinctfor improved readability and consistency.Minor cosmetic improvement: ASCII table output no longer includes a closing bottom rule by default.
spicy 0.3.0
CRAN release: 2025-10-22
- New function
code_book(), which generates a comprehensive variable codebook that can be viewed interactively and exported to multiple formats (copy, print, CSV, Excel, PDF).
spicy 0.2.1
CRAN release: 2025-10-04
-
label_from_names()now correctly handles edge cases when the separator appears in the label or is missing.
spicy 0.2.0
CRAN release: 2025-09-25
- New function
label_from_names()to derive and assign variable labels from headers of the form"name<sep>label"(e.g."name. label"). Especially useful for LimeSurvey CSV exports (Export results -> CSV -> Headings: Question code & question text), where the default separator is". ".
spicy 0.1.0
CRAN release: 2025-05-05
Initial release
- Introduces a collection of tools for variable inspection, descriptive summaries, and data exploration.
- Provides functions to:
- Extract variable metadata and display compact summaries (
varlist()). - Compute frequency tables (
freq()), cross-tabulations (cross_tab()), and Cramer’s V for categorical associations (cramer_v()). - Generate descriptive statistics such as means (
mean_n()), sums (sum_n()), and counts (count_n()) with automatic handling of missing data. - Copy data (
copy_clipboard()) directly to the clipboard for quick export.
- Extract variable metadata and display compact summaries (
