Package: formatters 0.5.9.9003

Joe Zhu

formatters: ASCII Formatting for Values and Tables

We provide a framework for rendering complex tables to ASCII, and a set of formatters for transforming values or sets of values into ASCII-ready display strings.

Authors:Gabriel Becker [aut], Adrian Waddell [aut], Davide Garolini [ctb], Emily de la Rua [ctb], Abinaya Yogasekaram [ctb], Joe Zhu [ctb, cre], F. Hoffmann-La Roche AG [cph, fnd]

formatters_0.5.9.9003.tar.gz
formatters_0.5.9.9003.zip(r-4.5)formatters_0.5.9.9003.zip(r-4.4)formatters_0.5.9.9003.zip(r-4.3)
formatters_0.5.9.9003.tgz(r-4.4-any)formatters_0.5.9.9003.tgz(r-4.3-any)
formatters_0.5.9.9003.tar.gz(r-4.5-noble)formatters_0.5.9.9003.tar.gz(r-4.4-noble)
formatters_0.5.9.9003.tgz(r-4.4-emscripten)formatters_0.5.9.9003.tgz(r-4.3-emscripten)
formatters.pdf |formatters.html
formatters/json (API)
NEWS

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

Peer review:

Bug tracker:https://github.com/insightsengineering/formatters/issues

Datasets:
  • DM - DM data
  • ex_adae - Simulated CDISC-like data for examples
  • ex_adaette - Simulated CDISC-like data for examples
  • ex_adcm - Simulated CDISC-like data for examples
  • ex_adlb - Simulated CDISC-like data for examples
  • ex_admh - Simulated CDISC-like data for examples
  • ex_adqs - Simulated CDISC-like data for examples
  • ex_adrs - Simulated CDISC-like data for examples
  • ex_adsl - Simulated CDISC-like data for examples
  • ex_adtte - Simulated CDISC-like data for examples
  • ex_advs - Simulated CDISC-like data for examples

On CRAN:

formatmatrixtable

9.99 score 15 stars 17 packages 22 scripts 2.0k downloads 116 exports 11 dependencies

Last updated 24 days agofrom:84e8c3ebd3. Checks:OK: 7. Indexed: no.

TargetResultDate
Doc / VignettesOKOct 28 2024
R-4.5-winOKOct 28 2024
R-4.5-linuxOKOct 28 2024
R-4.4-winOKOct 28 2024
R-4.4-macOKOct 28 2024
R-4.3-winOKOct 28 2024
R-4.3-macOKOct 28 2024

Exports:%||%all_footersall_titlesbasic_listing_mfbasic_matrix_formbasic_pagdfcheck_alignsclose_font_devdebug_font_devdecimal_aligndefault_hsepdefault_page_numberdiagnose_paginationdivider_heightdo_forced_paginateexport_as_pdfexport_as_rtfexport_as_txtfmt_configfont_specformat_valueis_valid_formatis.wholenumberlist_valid_alignslist_valid_format_labelsmain_footermain_footer<-main_titlemain_title<-make_row_dfmatrix_formMatrixPrintFormmf_alignsmf_aligns<-mf_cinfomf_cinfo<-mf_colgapmf_colgap<-mf_displaymf_display<-mf_fontspecmf_fontspec<-mf_formatsmf_formats<-mf_has_rlabelsmf_has_topleftmf_lgroupingmf_lgrouping<-mf_ncolmf_ncol<-mf_nlheadermf_nrheadermf_nrheader<-mf_nrowmf_rfnotesmf_rfnotes<-mf_rinfomf_rinfo<-mf_spansmf_spans<-mf_stringsmf_strings<-mpf_has_rlabelsmpf_to_rtfnchar_ttypencolnlinesnum_rep_colsnum_rep_cols<-obj_alignobj_align<-obj_formatobj_format<-obj_labelobj_label<-obj_na_strobj_na_str<-obj_nameobj_name<-open_font_devpadstrpag_indices_innerpagdfrowpage_dimpage_lcpppage_titlespage_titles<-page_typespaginate_indicespaginate_to_mpfspropose_column_widthsprov_footerprov_footer<-ref_df_rowround_fmtset_default_hsepset_default_page_numberspans_to_viscellsplit_word_ttypespread_integersprintf_formatsubtitlessubtitles<-table_insettable_inset<-toStringundebug_font_devvar_labelsvar_labels_removevar_labels<-var_relabelvert_pag_indiceswith_labelwrap_stringwrap_string_ttypewrap_txt

Dependencies:backportsbase64enccheckmateclidigestfastmapgluehtmltoolslifecyclerlangstringi

Introduction to the formatters package

Rendered fromformatters.Rmdusingknitr::rmarkdownon Oct 28 2024.

Last update: 2024-01-19
Started: 2022-03-25

Readme and manuals

Help Manual

Help pageTopics
Basic/spoof pagination info data framebasic_pagdf
Check if a format or alignment is supportedcheck_aligns check_formats is_valid_format
Decimal alignmentdecimal_align
Default horizontal separatordefault_horizontal_sep default_hsep set_default_hsep
Default page number formatdefault_page_number set_default_page_number
Divider heightdivider_height divider_height,ANY-method
DM dataDM
Generic for performing "forced" paginationdo_forced_paginate do_forced_paginate,ANY-method
Simulated CDISC-like data for examplesex_adae ex_adaette ex_adcm ex_adlb ex_admh ex_adqs ex_adrs ex_adsl ex_adtte ex_advs
Export as PDFexport_as_pdf
Export as RTFexport_as_rtf
Export a table-like object to plain (ASCII) text with page breaksexport_as_txt
Format configurationfmt_config
Font size specificationfont_spec
Converts a (possibly compound) value into a string using the 'format' informationformat_value
%||% (if length-0) alternative operator%||% ifnotlen0
Check if a value is a whole numberis.wholenumber
Label, name, and format accessor genericslab_name obj_align obj_align,ANY-method obj_align,fmt_config-method obj_align<- obj_align<-,ANY-method obj_align<-,fmt_config-method obj_format obj_format,ANY-method obj_format,fmt_config-method obj_format<- obj_format<-,ANY-method obj_format<-,fmt_config-method obj_label obj_label,ANY-method obj_label<- obj_label<-,ANY-method obj_name obj_name<- obj_na_str obj_na_str,ANY-method obj_na_str,fmt_config-method obj_na_str<- obj_na_str<-,ANY-method obj_na_str<-,fmt_config-method
List of currently supported formats and vertical alignmentslist_formats list_valid_aligns list_valid_format_labels
General title and footer accessorsall_footers all_titles main_footer main_footer,MatrixPrintForm-method main_footer<- main_footer<-,MatrixPrintForm-method main_title main_title,MatrixPrintForm-method main_title<- main_title<-,MatrixPrintForm-method page_titles page_titles,ANY-method page_titles,MatrixPrintForm-method page_titles<- page_titles<-,MatrixPrintForm-method prov_footer prov_footer,MatrixPrintForm-method prov_footer<- prov_footer<-,MatrixPrintForm-method subtitles subtitles,MatrixPrintForm-method subtitles<- subtitles<-,MatrixPrintForm-method
Make row layout summary data frames for use during paginationmake_row_df make_row_df,MatrixPrintForm-method
Transform 'rtable' to a list of matrices which can be used for outputtingmatrix_form matrix_form,MatrixPrintForm-method
Constructor for Matrix Print FormMatrixPrintForm
Class for Matrix Print FormMatrixPrintForm-class
Getters and setters for aspects of 'MatrixPrintForm' objectsmf_aligns mf_aligns<- mf_cinfo mf_cinfo<- mf_colgap mf_colgap<- mf_display mf_display<- mf_fontspec mf_fontspec<- mf_formats mf_formats<- mf_has_rlabels mf_has_topleft mf_lgrouping mf_lgrouping<- mf_ncol mf_ncol<- mf_nlheader mf_nrheader mf_nrheader<- mf_nrow mf_rfnotes mf_rfnotes<- mf_rinfo mf_rinfo<- mf_spans mf_spans<- mf_strings mf_strings<- mpf_has_rlabels ncol,MatrixPrintForm-method
Transform 'MatrixPrintForm' to RTFmpf_to_rtf
Calculate font-specific string widthnchar_ttype
Number of lines required to print a valuenlines nlines,character-method nlines,list-method nlines,NULL-method
Number of repeated columnsnum_rep_cols num_rep_cols,ANY-method num_rep_cols,MatrixPrintForm-method num_rep_cols<- num_rep_cols<-,ANY-method num_rep_cols<-,MatrixPrintForm-method
Activate font stateclose_font_dev debug_font_dev open_font_dev undebug_font_dev
Pad a string and align within stringpadstr
Find pagination indices from pagination info data framepag_indices_inner
Create a row of a pagination data framepagdfrow
Determine lines per page (LPP) and characters per page (CPP) based on font and page typepage_lcpp
Supported named page typespage_dim page_types
Paginate a table-like object for renderingdiagnose_pagination paginate paginate_indices paginate_to_mpfs pagination
Paginationpagination_algo
Printprint,ANY-method
Propose column widths based on the 'MatrixPrintForm' of an objectpropose_column_widths
Create a row for a referential footnote information data frameref_df_row
Round and prepare a value for displayrounding round_fmt
Transform a vector of spans (with duplication) into a visibility vectorspans_to_viscell
wrap string given a Truetype fontsplit_word_ttype wrap_string_ttype
Spread an integer to a given lengthspread_integer
Specify text format via a 'sprintf' format stringsprintf_format
Access or (recursively) set table insettable_inset table_inset,MatrixPrintForm-method table_inset<- table_inset<-,MatrixPrintForm-method
Create spoof matrix form from a data framebasic_listing_mf basic_matrix_form test_matrix_form
Transform objects into string representationstoString toString,MatrixPrintForm-method
Get label attributes of variables in a 'data.frame'var_labels
Remove variable labels of a 'data.frame'var_labels_remove
Set label attributes of all variables in a 'data.frame'var_labels<-
Copy and change variable labels of a 'data.frame'var_relabel
Find column indices for vertical paginationvert_pag_indices
Return an object with a label attributewith_label
Wrap a string to a precise widthwrap_string wrap_txt