Package: expss 0.11.6

expss: 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', '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.

Authors:Gregory Demin [aut, cre], Sebastian Jeworutzki [ctb], Dan Chaltiel [ctb], John Williams [ctb], Tom Elliott [ctb]

expss_0.11.6.tar.gz
expss_0.11.6.zip(r-4.5)expss_0.11.6.zip(r-4.4)expss_0.11.6.zip(r-4.3)
expss_0.11.6.tgz(r-4.4-any)expss_0.11.6.tgz(r-4.3-any)
expss_0.11.6.tar.gz(r-4.5-noble)expss_0.11.6.tar.gz(r-4.4-noble)
expss_0.11.6.tgz(r-4.4-emscripten)expss_0.11.6.tgz(r-4.3-emscripten)
expss.pdf |expss.html
expss/json (API)
NEWS

# Install 'expss' in R:
install.packages('expss', repos = c('https://gdemin.r-universe.dev', 'https://cloud.r-project.org'))

Peer review:

Bug tracker:https://github.com/gdemin/expss/issues

Datasets:
  • product_test - Data from product test of chocolate confectionary

On CRAN:

excellabelslabels-supportmsexcelpivot-tablesrecodespssspss-statisticstablesvariable-labelsvlookup

10.79 score 83 stars 4 packages 1.1k scripts 9.7k downloads 3 mentions 395 exports 38 dependencies

Last updated 8 months agofrom:d498caf72a. Checks:OK: 3 NOTE: 4. Indexed: yes.

TargetResultDate
Doc / VignettesOKNov 05 2024
R-4.5-winNOTENov 05 2024
R-4.5-linuxNOTENov 05 2024
R-4.4-winNOTENov 05 2024
R-4.4-macNOTENov 05 2024
R-4.3-winOKNov 05 2024
R-4.3-macOKNov 05 2024

Exports:....f..p..t%a%%col_in%%d%%e%%has%%i%%if_na%%into%%mis_val%%n_d%%n_i%%na_if%%nest%%r%%row_in%%thru%%to_list%%to%%u%add_columnsadd_labelled_classadd_rowsadd_sig_labelsadd_val_labadd_val_lab<-all_in_colall_in_rowandany_in_colany_in_rowapply_colapply_col_ifapply_dictionaryapply_labelsapply_rowapply_row_ifas_huxtable.etableas_isas.categoryas.criterionas.datatable_widgetas.dichotomyas.etableas.labelledas.sheetautonumcalccalc_crocalc_cro_casescalc_cro_cpctcalc_cro_cpct_responsescalc_cro_funcalc_cro_fun_dfcalc_cro_meancalc_cro_mean_sd_ncalc_cro_mediancalc_cro_pearsoncalc_cro_rpctcalc_cro_spearmancalc_cro_sumcalc_cro_tpctcalculatecell_chisqcombine_functionscompare_meanscompare_proportionscomputecontainscopycount_col_ifcount_ifcount_row_ifcreate_dictionarycrocro_casescro_cpctcro_cpct_responsescro_funcro_fun_dfcro_meancro_mean_sd_ncro_mediancro_pearsoncro_rpctcro_spearmancro_sumcro_tpctcross_casescross_cpctcross_cpct_responsescross_funcross_fun_dfcross_meancross_mean_sd_ncross_mediancross_pearsoncross_rpctcross_spearmancross_sumcross_tpctdo_ifdo_repeatdrop_all_labelsdrop_cdrop_empty_columnsdrop_empty_rowsdrop_rdrop_rcdrop_unused_labelsdrop_val_labsdrop_var_labsdummydummy1eqequalsexceptexpss_digitsexpss_disable_value_labels_supportexpss_enable_value_labels_supportexpss_enable_value_labels_support_extremeexpss_fix_encoding_offexpss_fix_encoding_onexpss_fre_stat_labexpss_output_commentedexpss_output_defaultexpss_output_huxtableexpss_output_rawexpss_output_rnotebookexpss_output_viewerexpss_round_half_to_evenfctrfixedfrefromfrom_togeget_captionget_expss_digitsget_expss_roundinggreatergreater_or_equalgtgtehashas_labelhihidehtmlTablehtmlTableWidgethtmlTableWidgetOutputif_naif_na<-if_valif_val<-ifsindex_colindex_rowindirectindirect_listinfointeractiveTableis_maxis_minis_nais.categoryis.criterionis.dichotomyis.etableis.labelledis.with_captionitemskeeplab_numlelessless_or_equallikeloltltemake_labelsmake_subheadingsmatch_colmatch_rowmax_colmax_col_ifmax_ifmax_rowmax_row_ifmdsetmdset_fmdset_pmdset_tmean_colmean_col_ifmean_ifmean_rowmean_row_ifmedian_colmedian_col_ifmedian_ifmedian_rowmedian_row_ifmin_colmin_col_ifmin_ifmin_rowmin_row_ifmis_valmis_val<-modifymodify_ifmrsetmrset_fmrset_pmrset_tn_diffn_intersectn2lna_ifna_if<-name_dotsnames2labelsneneqnestnetnotnot_equalsnot_nanum_labold_read_labelled_csvold_write_labelled_csvorotherperlprepend_allprepend_namesprepend_valuespropprop_colprop_rowqcqeread_labelled_csvread_labelled_csv2read_labelled_fstread_labelled_tabread_labelled_tab2read_labelled_xlsxread_spssrecrec<-recoderecode<-regexsd_colsd_col_ifsd_ifsd_rowsd_row_ifset_captionset_val_labset_var_labsheetsignificance_casessignificance_cell_chisqsignificance_cpctsignificance_meanssort_ascsort_descsplit_bysplit_columnssplit_labelssplit_offsplit_table_to_dfsubtotalsum_colsum_col_ifsum_ifsum_rowsum_row_iftab_captiontab_cellstab_colstab_last_add_sig_labelstab_last_hstacktab_last_roundtab_last_sig_casestab_last_sig_cell_chisqtab_last_sig_cpcttab_last_sig_meanstab_last_vstacktab_mis_valtab_net_cellstab_net_colstab_net_rowstab_pivottab_prepend_alltab_prepend_namestab_prepend_valuestab_row_labeltab_rowstab_significance_optionstab_sort_asctab_sort_desctab_stat_casestab_stat_cpcttab_stat_cpct_responsestab_stat_funtab_stat_fun_dftab_stat_maxtab_stat_meantab_stat_mean_sd_ntab_stat_mediantab_stat_mintab_stat_rpcttab_stat_sdtab_stat_setab_stat_sumtab_stat_tpcttab_stat_unweighted_valid_ntab_stat_valid_ntab_subgrouptab_subtotal_cellstab_subtotal_colstab_subtotal_rowstab_total_labeltab_total_row_positiontab_total_statistictab_transposetab_weighttext_to_columnstext_to_columns_csvtext_to_columns_csv2text_to_columns_tabtext_to_columns_tab2thrutototalunhideunlabunvlunvrunweighted_valid_nuse_labelsv_diffv_intersectv_unionv_xorv2lval_labval_lab<-validvalid_nvalue_col_ifvalue_row_ifvalues2labelsvar_labvar_lab<-varsvars_listw_corw_covw_madw_maxw_meanw_medianw_minw_nw_pearsonw_sdw_sew_spearmanw_sumw_varweight_bywhenwherewindow_funwrite_labelled_csvwrite_labelled_csv2write_labelled_fstwrite_labelled_spsswrite_labelled_tabwrite_labelled_tab2write_labelled_xlsxwrite_labelswrite_labels_spssxl_writexl_write_file

Dependencies:backportsbase64encbslibcachemcheckmateclidata.tabledigestevaluatefastmapfontawesomefsgluehighrhtmlTablehtmltoolshtmlwidgetsjquerylibjsonliteknitrlifecyclemaditrmagrittrmatrixStatsmemoisemimeR6rappdirsrlangrmarkdownrstudioapisassstringistringrtinytexvctrsxfunyaml

Examples

Rendered fromexamples.Rmdusingknitr::rmarkdownon Nov 05 2024.

Last update: 2022-01-06
Started: 2020-03-06

Export tables to xlsx files

Rendered fromxlsx-export.Rmdusingknitr::rmarkdownon Nov 05 2024.

Last update: 2022-01-06
Started: 2018-11-11

Tables with labels in R

Rendered fromtables-with-labels.Rmdusingknitr::rmarkdownon Nov 05 2024.

Last update: 2022-01-06
Started: 2018-01-23

Variable and value labels support in base R and other packages

Rendered fromlabels-support.Rmdusingknitr::rmarkdownon Nov 05 2024.

Last update: 2019-06-29
Started: 2018-01-23

Readme and manuals

Help Manual

Help pageTopics
Add columns to data.frame.add_columns
Add rows to data.frame/matrix/tableadd_rows add_rows.data.frame
Set variable labels/value labels on variables in the data.frameapply_labels
Convert table to huxtableas_hux.etable as_huxtable.etable
Convert dichotomy data.frame/matrix to data.frame with category encodingas.category is.category
Create an HTML table widget for usage with Shinyas.datatable_widget as.datatable_widget.etable as.datatable_widget.with_caption
Convert variable (possibly multiple choice question) to data.frame/matrix of dummy variables.as.dichotomy dummy dummy1 is.dichotomy
Convert data.frame/matrix to object of class 'etable'as.etable is.etable
Recode vector into numeric vector with value labelsas.labelled is.labelled
Calculate significance (p-values) of differences between proportions/meanscompare_means compare_proportions
Modify data.frame/modify subset of the data.framecalc calculate compute do_if modify modify_if use_labels
Count/sum/average/other functions on values that meet a criterion%col_in% %has% %row_in% apply_col_if apply_row_if count_col_if count_if count_row_if has max_col_if max_if max_row_if mean_col_if mean_if mean_row_if median_col_if median_if median_row_if min_col_if min_if min_row_if sd_col_if sd_if sd_row_if sum_col_if sum_if sum_row_if
Criteria functions%thru% and as.criterion contains criteria eq equals fixed from ge greater greater_or_equal gt gte has_label is.criterion is_max is_min is_na items le less less_or_equal like lt lte ne neq not not_equals not_na or other perl regex thru to when
Cross tabulation with support of labels, weights and multiple response variables.calc_cro calc_cro_cases calc_cro_cpct calc_cro_cpct_responses calc_cro_rpct calc_cro_tpct cro cross_cases cross_cpct cross_cpct_responses cross_rpct cross_tpct cro_cases cro_cpct cro_cpct_responses cro_rpct cro_tpct total
Cross-tabulation with custom summary function.calc_cro_fun calc_cro_fun_df calc_cro_mean calc_cro_mean_sd_n calc_cro_median calc_cro_pearson calc_cro_spearman calc_cro_sum combine_functions cross_fun cross_fun_df cross_mean cross_mean_sd_n cross_median cross_pearson cross_spearman cross_sum cro_fun cro_fun_df cro_mean cro_mean_sd_n cro_median cro_pearson cro_spearman cro_sum
Repeats the same transformations on a specified set of variables/valuesas_is do_repeat
Drop empty (with all NA's) rows/columns from data.frame/tabledrop_c drop_empty_columns drop_empty_rows drop_r drop_rc
expss: Tables with Labels and Some Useful Functions from Spreadsheets and SPSS Statisticsexpss
Options for controlling behavior of the packageexpss.options expss_digits expss_disable_value_labels_support expss_enable_value_labels_support expss_enable_value_labels_support_extreme expss_fix_encoding_off expss_fix_encoding_on expss_fre_stat_lab expss_output_commented expss_output_default expss_output_huxtable expss_output_raw expss_output_rnotebook expss_output_viewer expss_round_half_to_even get_expss_digits get_expss_rounding
Convert labelled variable to factorfctr
Simple frequencies with support of labels, weights and multiple response variables.fre
Outputting HTML tables in RStudio viewer/R NotebookshtmlTable.etable htmlTable.list htmlTable.with_caption knit_print.etable knit_print.with_caption repr_html.etable repr_html.with_caption repr_text.etable repr_text.with_caption
Replace values with NA and vice-versa%if_na% %mis_val% %na_if% if_na if_na<- mis_val mis_val<- na_if na_if<- valid
Provides variables description for datasetinfo
Keep or drop elements by name/criteria in data.frame/matrixexcept keep
Match finds value in rows or columns/index returns value by index from rows or columnsindex_col index_row match_col match_row value_col_if value_row_if
Merge two tables/data.framesmerge.etable
Create multiple response set/multiple dichotomy set from variablesmdset mdset_f mdset_p mdset_t mrset mrset_f mrset_p mrset_t
Bug workaroundname_dots
Replace data.frame/list names with corresponding variables labels.n2l names2labels
Compute nested variable(-s) from several variables%nest% nest
Add subtotal to a set of categorieshide net subtotal tab_net_cells tab_net_cols tab_net_rows tab_subtotal_cells tab_subtotal_cols tab_subtotal_rows unhide
Prepend values/variable names to value/variable labelsprepend_all prepend_names prepend_values tab_prepend_all tab_prepend_names tab_prepend_values
Data from product test of chocolate confectionaryproduct_test
Compute proportions from numeric vector/matrix/data.frameprop prop_col prop_row
Create vector of characters from unquoted strings (variable names)qc qe
Read an SPSS Data Fileread_spss read_spss_to_list
Change, rearrange or consolidate the values of an existing or new variable. Inspired by the RECODE command from SPSS.%into% copy from_to hi ifs if_val if_val<- lo rec rec<- recode recode<-
Add caption to the tableget_caption is.with_caption set_caption
Make data.frame without conversion to factors and without fixing namesas.sheet sheet
Sort data.frames/matrices/vectorssort_asc sort_desc
Splits data.frame into list of data.frames that can be analyzed separatelysplit_by split_off
Split character vector to matrix/split columns in data.framemake_subheadings split_columns split_labels split_table_to_df
Compute sum/mean/sd/median/max/min/custom function on rows/columnsall_in_col all_in_row any_in_col any_in_row apply_col apply_row max_col max_row mean_col mean_row median_col median_row min_col min_row sd_col sd_row sum_col sum_row
Mark significant differences between columns in the tableadd_sig_labels cell_chisq significance significance_cases significance_cell_chisq significance_cpct significance_means tab_last_add_sig_labels tab_last_round tab_last_sig_cases tab_last_sig_cell_chisq tab_last_sig_cpct tab_last_sig_means tab_significance_options
Partially (inside blocks) sort tables/data.framestab_sort_asc tab_sort_desc
Functions for custom tables constructiontables tab_caption tab_cells tab_cols tab_last_hstack tab_last_vstack tab_mis_val tab_pivot tab_rows tab_row_label tab_stat_cases tab_stat_cpct tab_stat_cpct_responses tab_stat_fun tab_stat_fun_df tab_stat_max tab_stat_mean tab_stat_mean_sd_n tab_stat_median tab_stat_min tab_stat_rpct tab_stat_sd tab_stat_se tab_stat_sum tab_stat_tpct tab_stat_unweighted_valid_n tab_stat_valid_n tab_subgroup tab_total_label tab_total_row_position tab_total_statistic tab_transpose tab_weight
Make data.frame from texttext_to_columns text_to_columns_csv text_to_columns_csv2 text_to_columns_tab text_to_columns_tab2
Drop variable label and value labelsdrop_all_labels unlab
Set or get value labelsadd_val_lab add_val_lab<- autonum drop_unused_labels drop_val_labs lab_num make_labels num_lab set_val_lab unvl val_lab val_lab<-
Replace vector/matrix/data.frame/list values with corresponding value labels.v2l values2labels
Set or get variable labeladd_labelled_class drop_var_labs set_var_lab unvr var_lab var_lab<-
Get variables/range of variables by name/by pattern.%to% %to_list% .. ..f ..p ..t indirect indirect_list vars vars_list
Infix operations on vectors - append, diff, intersection, union, replication%a% %d% %e% %i% %n_d% %n_i% %r% %u% n_diff n_intersect vectors v_diff v_intersect v_union v_xor
Compute various weighted statisticsunweighted_valid_n valid_n w_cor w_cov w_mad w_max w_mean w_median w_min w_n w_pearson w_sd w_se w_spearman w_sum w_var
Create dataset according to its frequency weightsweight_by
Subset (filter) data.frames/matrices/vectors/listswhere
Function over grouping variables (window function)window_fun
Write labelled data to file or export file to SPSS syntax.apply_dictionary create_dictionary old_read_labelled_csv old_write_labelled_csv read_labelled_csv read_labelled_csv2 read_labelled_fst read_labelled_tab read_labelled_tab2 read_labelled_xlsx write_labelled_csv write_labelled_csv2 write_labelled_fst write_labelled_spss write_labelled_tab write_labelled_tab2 write_labelled_xlsx write_labels write_labels_spss
Write tables and other objects to an xlsx file with formattingxl_write xl_write.default xl_write.etable xl_write.list xl_write.with_caption xl_write_file