Package: tangram 0.8.2

Shawn Garbett

tangram: The Grammar of Tables

Provides an extensible formula system to quickly and easily create production quality tables. The processing steps are a formula parser, statistical content generation from data as defined by formula, followed by rendering into a table. Each step of the processing is separate and user definable thus creating a set of composable building blocks for highly customizable table generation. A user is not limited by any of the choices of the package creator other than the formula grammar. For example, one could chose to add a different S3 rendering function and output a format not provided in the default package, or possibly one would rather have Gini coefficients for their statistical content in a resulting table. Routines to achieve New England Journal of Medicine style, Lancet style and Hmisc::summaryM() statistics are provided. The package contains rendering for HTML5, Rmarkdown and an indexing format for use in tracing and tracking are provided.

Authors:Shawn Garbett [aut, cre], Thomas Stewart [ctb], Jennifer Thompson [ctb], Frank Harrell [ctb], Ahra Kim [ctb]

tangram_0.8.2.tar.gz
tangram_0.8.2.zip(r-4.5)tangram_0.8.2.zip(r-4.4)tangram_0.8.2.zip(r-4.3)
tangram_0.8.2.tgz(r-4.4-any)tangram_0.8.2.tgz(r-4.3-any)
tangram_0.8.2.tar.gz(r-4.5-noble)tangram_0.8.2.tar.gz(r-4.4-noble)
tangram_0.8.2.tgz(r-4.4-emscripten)tangram_0.8.2.tgz(r-4.3-emscripten)
tangram.pdf |tangram.html
tangram/json (API)

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

Peer review:

Bug tracker:https://github.com/spgarbet/tangram/issues

Datasets:
  • pbc - Mayo Clinic Primary Biliary Cirrhosis Data

On CRAN:

99 exports 66 stars 3.63 score 18 dependencies 2 mentions 62 scripts 339 downloads

Last updated 2 years agofrom:bd3fc4b470. Checks:OK: 3 NOTE: 4. Indexed: yes.

TargetResultDate
Doc / VignettesOKSep 01 2024
R-4.5-winNOTESep 01 2024
R-4.5-linuxNOTESep 01 2024
R-4.4-winOKSep 01 2024
R-4.4-macOKSep 01 2024
R-4.3-winNOTESep 01 2024
R-4.3-macNOTESep 01 2024

Exports:add_coladd_footnoteadd_indentadd_rowas.categoricalASTFunctionASTMultiplyASTPlusASTTableFormulaASTVariablecarriage_returncellcell_headercell_labelcell_ncell_subheadercell_transformcol_headercolscsvcursor_downcursor_leftcursor_poscursor_rightcursor_upcustom_cssdel_coldel_rowderive_labeldrop_statisticsformat_guesshmischmisc_cellhmisc_chi2hmisc_data_typehmisc_fractionhmisc_fstathmisc_intercept_cleanuphmisc_iqrhmisc_phmisc_spearmanhmisc_wilcoxhomehtml5indexinsert_columninsert_rowis.binomialis.categoricalkeylancetlancet_celllancet_fractionlancet_mean_sdlatexlatex_templatelatexifyline_feednejmnejm_cellnejm_fractionnejm_iqrnew_colnew_linenew_rowParserproc_tabrender_freplace_cellrmdrow_headerrowsrtfselect_colselect_rowset_captionset_colspanset_footnoteset_idset_rowspanset_stylesmdsmd_cellsmd_comparesmd_contingencysmd_distsmd_fractionsmd_meansdstandard_differencesummarize_chisqsummarize_kruskal_horzsummarize_kruskal_vertsummarize_nejm_horzsummarize_nejm_vertsummarize_spearmantable_applytable_flattentangramwrite_cell

Dependencies:base64encclidigestevaluatefastmapgluehighrhtmltoolsknitrlifecyclemagrittrR6rlangstringistringrvctrsxfunyaml

Readme and manuals

Help Manual

Help pageTopics
Provide a "+" operator for rbind of tangram tables+.tangram
Add a footnote to a tableadd_footnote
Add indentations to left column row headersadd_indent
Flatten variable argumentsargs_flatten
Convert data type to a factor if it's not alreadyas.categorical
A left/right branch in an Abstract Syntrax Tree. This inherits from ASTNode, and is intended to be a base class as well. Should never be instantiated directly as once again the semantic information is contained in the class name.ASTBranch
A specified function call as an ASTNodeASTFunction
The multiplication of two terms, as an ASTNode.ASTMultiply
A Node in an Abstract Syntax Tree (AST)ASTNode
The addition of two terms, in an ASTNode.ASTPlus
The root ASTNode of a formula.ASTTableFormula
A Variable in an Abstract Syntax Tree (AST)ASTVariable
A cbind for generated table tangram objects.cbind.tangram
Construct a table cell from an objectcell
Create a cell_header object of the given text.cell_header
Create an cell_label (S3) object of the given text.cell_label
Create an cell_n (S3) object of the given statisticcell_n
Create a cell_subheader object of the given text.cell_subheader
Create a function to transform all cells of a tablecell_transform
A set of magrittr operators for tangram tablesadd_col add_row carriage_return col_header cursor_down cursor_left cursor_pos cursor_right cursor_up home line_feed new_col new_line new_row row_header set_caption set_colspan set_footnote set_id set_rowspan set_style table_apply write_cell
Generate an csv from a tangram or cell objectcsv csv.default csv.tangram
Return a CSS file as a stringcustom_css
Delete given column(s) from a tabledel_col
Delete a row(s) from a tabledel_row
Derive label of AST node.derive_label
Drop all statistics columns from a table.drop_statistics
Guess the best format for a given set of numerical dataformat_guess
Determine data type of a vector loosely consistent with Hmisc.hmisc_data_type
Cleanup an intercept only modelhmisc_intercept_cleanup
Cell Generation functions for hmisc defaulthmisc_cell hmisc_chi2 hmisc_fraction hmisc_fstat hmisc_iqr hmisc_p hmisc_spearman hmisc_wilcox
S3 html5 Method function for use on a tangram to generate HTML5html5
Convert an abstract cell object into an HTML5 stringhtml5.cell
Convert an abstract cell_header object into an HTML5 stringhtml5.cell_header
Convert a cell_label object into an HTML5 stringhtml5.cell_label
Convert an abstract cell_n object into an HTML5 stringhtml5.cell_n
Convert an abstract cell_subheader object into an HTML5 stringhtml5.cell_subheader
Default conversion to HTML5 for a character cellhtml5.character
Default conversion to HTML5 for an abstract table elementhtml5.default
Default conversion to HTML5 for a logical cellhtml5.logical
Convert a tangram class into an HTML5 stringhtml5.tangram
Generate an index from a tangram or cell objectindex
Generate an index from a label objectindex.cell_label
Generate an index from a cell objectindex.default
Generate an index from a list objectindex.list
Generate an an index from a tangram objectindex.tangram
Insert a column into a tangram tableinsert_column
Insert a row into a tangram tableinsert_row
Determine if a vector is binomial or notis.binomial
Determine if a vector is categorical or notis.categorical
Key derivation helper functionkey
Style Bundle for Lancet stylelancet
Cell Generation functions for Lancet stylinglancet_cell
Create an cell_fraction (S3) in NEJM style of the given datalancet_fraction
Create a mean/sd cell object of the given data in Lancet stylelancet_mean_sd
Render to LaTeX methods for tangram cell objectslatex latex.cell latex.cell_header latex.cell_label latex.cell_subheader latex.default latex.logical latex.tangram
Return a LaTeX template that works with tangramlatex_template
LaTeX safe string conversionlatexify
Style Bundle for Closer to NEJM stylenejm
Cell Generation functions for nejm defaultnejm_cell
Create an cell_fraction (S3) in NEJM style of the given datanejm_fraction
Create a interquartile range cell object of the given data NEJM stylenejm_iqr
Create a NEJM style rangenejm_range
The parser class for generating abstract syntax trees for given table formulas.Parser
Mayo Clinic Primary Biliary Cirrhosis Datapbc
Provide a "|" operator for cbind of tangram tablespipe.tangram |.tangram
Print methods for tangram objectsprint.cell print.summary.tangram print.tangram
Tangram transform for proc_tab style summaries via a functionproc_tab
An rbind for generated tables tangram objects.rbind.tangram
Format a vector of provided numeric valuesrender_f
Router for rendering methodrender_route_tangram
Replace a cell's contentsreplace_cell
Generate an Rmd table entry from a cell objectrmd rmd.cell rmd.cell_n rmd.default rmd.tangram
S3 object to return number of rows/cols in objectcols cols.list rows rows.list
S3 rtf Method function for use on abstract table classrtf
Default conversion to RTF for an abstract table elementrtf.default
Convert a tangram into an RTF string or filertf.tangram
Select given column(s) from a tableselect_col
Select given row(s) from a tableselect_row
List of lists, should contain a "Type" entry with a function to determine type of vector passed in. Next entries are keyed off returned types from function, and represent the type of a row. The returned list should contain the same list of types, and represents the type of a column. Thus it now returns a function to process the intersection of those two types.smd
Cell Generation functions for SMD comparisons of categorical to numericalsmd_cell
Create a SMD for a categorical set of column versus a numerical rowsmd_compare
Create a contingency table with SMD given a row column of a formulasmd_contingency
Create an SMD distance cellsmd_dist
Create a fraction cell in the smd transformsmd_fraction
Create an SMD mean and standard deviation cellsmd_meansd
Compute the standardized mean distance between 2 groups for numerical or categorical information. Using method described in 'A unifed approach to measuring the effect size between two groups using SAS' by Dongsheng Yand and Jarrod E. Dalton, 2012. SAS Global Forum 2012standard_difference
Style Bundle for Hmisc defaultshmisc summarize_chisq summarize_kruskal_horz summarize_kruskal_vert summarize_spearman
Create a summarization for a categorical set of column versus a numerical row in NEJM stylesummarize_nejm_horz
Create a summarization for a categorical row versus X numerical columnsummarize_nejm_vert
The default method for rendering tangram objectssummary.cell summary.tangram
Given a tangram object with embedded tables, flattens to a single table.table_flatten
Table creation methodstangram tangram.anova.lme tangram.character tangram.clmm2 tangram.data.frame tangram.formula tangram.ftable tangram.lm tangram.matrix tangram.numeric tangram.rms tangram.summary.clmm2 tangram.summary.lm tangram.table tangram.tbl_df
A token in the formula grammarToken