Tables, Labels and Some Useful Functions from Spreadsheets and 'SPSS' Statistics

Package computes and displays tables with support for 'SPSS'-style labels, multiple and nested banners, weights, multiple-response variables and significance testing. There are facilities for nice output of tables in 'knitr', 'Shiny', '*.xlsx' files, R and 'Jupyter' notebooks. Methods for labelled variables add value labels support to base R functions and to some functions from other packages. Additionally, the package brings popular data transformation functions from 'SPSS' Statistics and 'Excel': 'RECODE', 'COUNT', 'COMPUTE', 'DO IF', 'COUNTIF', 'VLOOKUP' and etc. These functions are very useful for data processing in marketing research surveys. Package intended to help people to move data processing from 'Excel' and 'SPSS' to R.


0.8.11 (16.04.2019)

  • UPDATE IS REQUIRED. fixes for R>=3.6 and data.table >=1.12.2.
  • now htmlTable respects 'align' argument (Issue #20)
  • fix 'add_labelled_class' for 'haven' 2.0
  • improve SPSS syntax in 'write_labelled_spss'
  • add new significance test - 'significance_cell_chisq'/'tab_last_sig_cell_chisq'. Idea by Roberto Gilsaura.
  • now 'significance_cases' has new argument 'correct' for Yates' correction. By default it is TRUE
  • add 'qe' function for making list of expressions
  • ..$ selector now supports arbitrary expression
  • fix bug in 'cro_mean_sd_n with incorrect weighted valid n in some cases
  • Numerous small bugfixes

0.8.10 (12.12.2018)

  • 'nest' - more consistent behaviour for 'a %nest% list(x, y, z)`
  • 'split_off' now respects data.table and etable classes
  • 'xl_write' supports functions in 'additional_cells_formats' argument

0.8.8 (11.11.2018)

  • add '*.xlsx' export for tables via 'openxlsx' package. See ?xl_write
  • add 'set_caption' function and support for it in 'htmlTable', 'as.datatable_widget' and *.xlsx export
  • add function 'expss_enable_value_labels_support_extreme'
  • small bugfixes and performance improvement
  • 'from_text' renamed to 'text_to_columns'
  • 'by_groups' is deprecated now. Use 'take' from 'maditr' instead.
  • 'dtfrm'/'as.dtfrm' are finally removed. Use 'sheet'/'as.sheet' instead
  • 'lst'/'.lst' are removed

0.8.7 (12.06.2018)

  • fix long-standing bug with broken html rendering in knitr (issue #6)
  • add '..p' and '..f' - perl regular expression/fixed pattern selectors. Also 'mrset_p', 'mrset_f', 'mdset_p', 'mdset_f' are provided.
  • add shortcut for entire data.frame in 'use_labels'
  • fix awful bug with incorrect nesting multiple response on multiple response ('nest' function)
  • more exports from data.table
  • fix 'add_columns' for data.table
  • fix 'do_if' for data.table
  • fix 'w_cor' - now diag elements always equal to one
  • add 'split_by' - alias for 'split_separate'

0.8.6 (24.01.2018)

  • fix tests for systems with no long doubles support
  • new arguments and small improvements in 'write_labelled_csv'/'write_labelled_sps'
  • minor fixes
  • change 'vlookup'/'vlookup_df' behavior - now it also matches on NA
  • 'datatable' is deprecated. Use as.datatable_widget instead.
  • move DT and htmltools dependencies from Imports to Suggests
  • new function 'add_columns' which is inspired by MATCH FILES (Add variables...) from SPSS Statistics

0.8.4 (11.12.2017)

  • compatibility with new version of htmlTable package
  • minor fixes

0.8.3 (06.11.2017)

  • add 'calc_cro_*' functions family
  • minor fixes
  • compatibility with new version of 'testthat' package

0.8.2 (26.09.2017)

  • fix bug with single column "mrset"
  • fix bug with significance tests on tables with complex headers
  • add uboxing possibilities for ..
  • add 'text_to_columns' for creation data.frame from text lines
  • improve performance of 'cro_*'
  • remove deprecated function ".set"

0.8.1 (10.08.2017)

  • add significance testing (see ?significance)
  • add support for table output for Jupyter notebooks
  • add 'use_labels' function for experimental support variable labels in base R functions and third party packages (see ?use_labels)
  • increase table functions performance
  • increase 'as.dichotomy'/'dummy' performance
  • increase 'vlookup'/'vlookup_df' performance
  • numerous bugfixes
  • now 'keep'/'except'/'by_groups' operate with NSE. For standard evaluation just surround you variable with round brackets
  • add print options 'commented' for printing tables to console with '#'
  • add functions 'split_separate'/'split_off'
  • add 'prepend_names'/'prepend_labels' - issue #2
  • add 'indirect'/'indirect_list' - aliases for 'vars'/'vars_list'
  • add 'mis_val' - alias for 'na_if'
  • add 'unsafe' argument for _fun/_fun_df.
  • add '..' object for parameter substitution inside 'compute' and etc. Usage: '..$param_name'. For details: ?..
  • improve 'lst' function
  • '.set'/'set' inside 'compute' and etc. are deprecated. Use '%into%' instead.
  • expansion of variables in backticks inside 'vars'/'vars_list'/'%into%' is removed. Use explicit 'subst' instead
  • infix/assignment versions removed: '%modify%', '%compute%', '%sort_asc%', '%sort_desc%', '%keep%', '%except%', '%where%', '%by_groups%'

0.7.1 (10.04.2017)

  • make value labels support in the base R and other packages (via 'factor' for class 'labelled')
  • radically improved performace for 'cro_' and 'fre_' due to 'data.table' under the hood
  • multiple/nested banners/variables suppport in 'cro_*'
  • add 'datatable' for tables representation in Shiny
  • add 'htmlTables' for tables representation in RStudio viewer and for knitting to html
  • add methods for where for vectors/matrices/lists
  • less cryptic message about bad number of rows in modify/modify_if
  • .N now is preferable to .n inside modify and etc.
  • Functions for default dataset now invisibly return modified default dataset
  • Fix logical arguments in boolean operations for criteria functions
  • %in_row%/%in_col% are deprecated. Use %row_in%/%col_in% instead.
  • NULL argument for criterion is removed. Use not_na instead.
  • remove default argument in ifs. Use TRUE ~ default_value instead.
  • add usual vectors functions additionally to infix versions.
  • add 'do_repeat' function
  • add functions for weighted statistics - 'w_mean', 'w_median', 'w_cor' and etc.
  • add 'nest' function for creation nested tables.
  • remove 'category', 'category_df' - use 'as.category' instead
  • remove 'dichotomy', 'dichotomy1' - use 'dummy', 'dummy1' instead
  • remove 'dichotomy_df', 'dichotomy_df1' - use 'as.dichotomy' instead
  • remove labelled matrix support
  • bugfixes

0.5.5 (19.10.2016)

  • numerous bugfixes
  • change behavior of if_val() - now it dowsn't copies old values by default. There are 'other' and 'copy' instead of dots.
  • add %n_i%, %n_d% - names intersection and diffs
  • add add_rows function
  • add keep and except functions for selecting/dropping columns in data.frames
  • add 'where' for filtering dataset
  • add sort_asc and sort_desc functions for sorting data.frames

0.5.1 (07.07.2016)

  • initial release

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.


0.10.7 by Gregory Demin, a year ago

Report a bug at

Browse source code at

Authors: Gregory Demin [aut, cre] , Sebastian Jeworutzki [ctb]

Documentation:   PDF Manual  

GPL (>= 2) license

Imports foreign, utils, stats, magrittr, htmlTable, matrixStats, data.table

Suggests DT, htmltools, knitr, rmarkdown, repr, ggplot2, testthat, openxlsx, fst, huxtable

Imported by eph.

Suggested by crosstable.

See at CRAN