Learn R Programming

tsg

The tsg package provides a set of functions for generating frequency tables, cross-tabulations, and formatted output tables. It is designed to work with data frames and supports various customization options.

Installation

install.packages("tsg")

Basic usage

library(tsg)

generate_frequency(person_record, sex)

generate_crosstab(person_record, marital_status, sex)

person_record |> 
  generate_crosstab(marital_status, sex) |> 
  generate_output(
    path = "crosstab.xlsx",
    format = "xlsx"
  )

More examples here.

Copy Link

Version

Install

install.packages('tsg')

Monthly Downloads

235

Version

0.1.1

License

MIT + file LICENSE

Issues

Pull Requests

Stars

Forks

Maintainer

Bhas Abdulsamad

Last Published

February 12th, 2026

Functions in tsg (0.1.1)

collapse_list

Collapse a list of data frames or tibbles into a single data frame
add_table_title

Add a title attribute to a table
add_row_total

Add a row total
convert_factor

Convert labelled factors to regular factors
add_footnote

Add a footnote attribute to a table
add_table_subtitle

Add a subtitle attribute to a table
add_facade_alt

Add a facade to a tsg table (alternative way)
add_source_note

Add a source note attribute to a table
add_column_total

Add a column total
add_facade

Add a facade to a tsg table
generate_crosstab

Generate cross-tabulation
rename_label

Rename data labels
get_tsg_facade

Get a facade from the package or a file
write_xlsx

Write Data to Excel with Titles, Notes, and Styling
generate_template

Generate a template
generate_frequency

Generate frequency table
remove_labels

Remove all labels
remove_label

Remove data labels
person_record

Sample dataset of persons
generate_output

Generate output in specified format (e.g., xlsx, html, pdf, word)