Git Product home page Git Product logo

rtables's Introduction

rtables

Build Status

Reporting tables with R

The rtables R package is a prototype to create and display complex tables with R. The cells in an rtable may contain any high-dimensional data structure which can then be displayed with cell-specific formatting instructions. Currently, rtables can be outputted in ascii and html.

Some of our requirements and reasons to create this new table package are:

  • multiple values displayed within a cell
  • values need to be programmatically accessible for cross-checking
  • flexible formatting (cell spans, rounding, alignment, etc.)
  • composition of an rtable object from other rtable objects
  • multiple output formats (html, ascii, latex, pdf)
  • flexible pagination

Note that the current state of rtables does not fulfill all of those requirements. We are looking for collaborators, see the next section.

Collaboration and Planned API Changes

The current state of the rtables functionality is a first rough prototype. We will be changing the API significantly in the coming months without maintaining backward compatibility. We will release the rtable package on CRAN once we have a stable version.

We are looking for collaborators to help define and shape the rtables package. Please contact me if you would like to align your contributions to the current development plans or feel free to fork the repository and to send us pull requests with the suggested improvements.

Installation

To install the stable release of rtables package run the following command in R:

devtools::install_github("roche/rtables", ref="v0.1.0")

To install the test version of rtables run

devtools::install_github("roche/rtables")

Usage

library(rtables)
tbl <- rtable(
  header = c("Treatement\nN=100", "Comparison\nN=300"),
  format = "xx (xx.xx%)",
  rrow("A", c(104, .2), c(100, .4)),
  rrow("B", c(23, .4), c(43, .5)),
  rrow(),
  rrow("this is a very long section header"),
  rrow("estimate", rcell(55.23, "xx.xx", colspan = 2)),
  rrow("95% CI", indent = 1, rcell(c(44.8, 67.4), format = "(xx.x, xx.x)", colspan = 2))
)
tbl
#>                                           Treatement        Comparison
#>                                             N=100             N=300   
#> ----------------------------------------------------------------------
#> A                                         104 (20%)         100 (40%) 
#> B                                          23 (40%)          43 (50%) 
#> 
#> this is a very long section header
#> estimate                                             55.23            
#>   95% CI                                          (44.8, 67.4)

Presentations

rtables's People

Contributors

waddella avatar anajens avatar nautilussu avatar stawiara avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.