Giter VIP home page Giter VIP logo

r2rtf's Introduction

r2rtf

CRAN status Codecov test coverage CRAN Downloads R-CMD-check status

Overview

r2rtf is an R package to create production-ready tables and figures in RTF format. The R package is designed to

  • provide simple β€œverb” functions that correspond to each component of a table, to help you translate data frame(s) to a table in RTF file.
  • enables pipes (%>%).
  • only focus on table format.
    • Data manipulation and analysis shall be handled by other R packages. (e.g., tidyverse)
  • minimizes package dependency

Installation

You can install the package via CRAN:

install.packages("r2rtf")

Or, install from GitHub:

remotes::install_github("Merck/r2rtf")

Highlighted Features

The R packager2rtf provided flexibility to enable features below:

  • Necessary options to create highly customized RTF table and figure.
  • Simple to use parameters and data structure.
    • Customized column header: split by "|".
    • Three required parameters for the output tables (data, filename, column relative width).
    • Flexible and detail control of table structure.
  • Format control in cell, row, column and table level for:
    • Border Type: single, double, dash, dot, etc.
    • Alignment: left, right, center, decimal.
    • Column width.
    • Text appearance: bold, italics, strikethrough, underline and any combinations.
    • Font size.
    • Text and border color (657 different colors named in color() function).
    • Special characters: any character in UTF-8 encoding (e.g., Greek, Symbol, Chinese, Japanese, Korean).
  • Append several tables into one file.
  • Pagination.
  • Built-in raw data for validation.

Simple Example

library(dplyr)
library(r2rtf)

head(iris) %>%
  rtf_body() %>%                 # Step 1 Add attributes
  rtf_encode() %>%               # Step 2 Convert attributes to RTF encode
  write_rtf(file = "ex-tbl.rtf") # Step 3 Write to a .rtf file
Click here to see the output

Example Efficacy Table

Click here to see the output

Example Safety Table

Click here to see the output

r2rtf's People

Contributors

elong0527 avatar nanxstats avatar kongfans53 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.