Skip to content

insightsengineering/rlistings

Repository files navigation

rlistings

Check πŸ›  Docs πŸ“š Code Coverage πŸ“”

GitHub forks GitHub Repo stars

GitHub commit activity GitHub contributors GitHub last commit GitHub pull requests GitHub repo size GitHub language count WIP – Initial development is in progress, but there has not yet been a stable, usable release suitable for the public. Current Version Open Issues

Listings with R

The rlistings R package is a package that was designed to create and display listings with R. The focus of this package is to provide functionality for value formatting and ASCII rendering infrastructure for tables and listings. Many of the functions contained in rlistings depend on the formatters package, which provides a framework for ASCII rendering and is available on CRAN.

rlistings development is driven by the need to create regulatory ready listings for health authority review. Some of the key requirements for this undertaking are listed below:

  • flexible formatting (pagesize, column widths, alignment, labels, etc.)
  • multiple output formats (csv, out, txt)
  • repeated key columns
  • flexible pagination in both horizontal and vertical directions
  • titles and footnotes

rlistings currently covers some of these requirements, and remains under active development.

Installation

rlistings is available on CRAN and you can install the latest released version with:

install.packages("rlistings")

or you can install the latest development version directly from GitHub with:

# install.packages("pak")
pak::pak("insightsengineering/rlistings")

Packaged releases (both those on CRAN and those between official CRAN releases) can be found in the releases list.

To understand how to use this package, please refer to the Introduction to rlistings article, which provides multiple examples of code implementation.

Cheatsheet

Usage

The following example shows a simple listing and its printed output.

library(rlistings)
#> Loading required package: formatters
#> 
#> Attaching package: 'formatters'
#> The following object is masked from 'package:base':
#> 
#>     %||%
#> Loading required package: tibble

# Reducing the data
mtcars_ex <- mtcars %>% dplyr::mutate("car" = rownames(mtcars))

as_listing(mtcars_ex,
  key_cols = c("gear", "carb"),
  disp_cols = c("gear", "carb", "qsec", "car")
) %>% head()
#> gear   carb   qsec           car       
#> β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”
#>  3      1     19.44    Hornet 4 Drive  
#>               20.22        Valiant     
#>               20.01     Toyota Corona  
#>         2     17.02   Hornet Sportabout
#>               16.87   Dodge Challenger 
#>               17.3       AMC Javelin

Acknowledgment

This package is a result of a joint effort by many developers and stakeholders. We would like to thank everyone who contributed so far!

Stargazers and Forkers

Stargazers over time

Stargazers over time

Stargazers

Stargazers repo roster for @insightsengineering/rlistings

Forkers repo roster for @insightsengineering/rlistings

About

Value formatting and ASCII rendering infrastructure for tables and listings.

Resources

Code of conduct

Security policy

Stars

Watchers

Forks

Sponsor this project

Packages

No packages published

Languages