ProductPromotion
Logo

R Programming

made by https://0x3d.site

GitHub - renkun-ken/formattable: Formattable Data Structures
Formattable Data Structures. Contribute to renkun-ken/formattable development by creating an account on GitHub.
Visit Site

GitHub - renkun-ken/formattable: Formattable Data Structures

GitHub - renkun-ken/formattable: Formattable Data Structures

formattable

R build status codecov.io CRAN Version

This package is designed for applying formatting on vectors and data frames to make data presentation easier, richer, more flexible and hopefully convey more information.

This document is also translated into 日本語 by [@hoxo_m](https://github.com/hoxo-m), [@dichika](https://github.com/dichika) and [@teramonagi](https://github.com/teramonagi).

Install

The package is available on both GitHub and CRAN.

Install from GitHub:

Install from CRAN:

Introduction

Atomic vectors are basic units to store data. Some data can be read more easily with formatting. A numeric vector, for example, stores a group of percentage numbers yet still shows in the form of typical floating numbers. This package provides functions to create data structures with predefined formatting rules so that these objects store the original data but are printed with formatting.

The package provides several typical formattable objects such as percent, comma, currency, accounting and scientific. These objects are essentially numeric vectors with pre-defined formatting rules and parameters. For example,

The percent vector is no different from a numeric vector but has a percentage representation as being printed. It works with arithmetic operations and common functions and preserves its formatting.

These functions are special cases of what formattable() can do. formattable() applies highly customizable formatting to objects of a wide range of classes like numeric, logical, factor, Date, data.frame, etc. A typical data frame may look more friendly with formattable column vectors. For example,

Formatting tables in dynamic document

In a typical workflow of dynamic document production, knitr and rmarkdown are powerful tools to render documents with R code to different types of portable documents.

knitr is able to render an RMarkdown document (markdown document with R code chunks) to Markdown document. rmarkdown calls pandoc to render a markdown document to HTML web page. To put a table (data.frame in R) on the page, one may call knitr::kable to produce its markdown representation. By default the resulted table is in a plain theme with no additional formatting. However, in some cases, additional formatting may help clarify the information and make contrast of the data. This package provides functions to produce formatted tables in dynamic documents.

Plain table:

Formatted table with the following visualizations:

  • Ages are rendered in gradient.
  • All A grades are displayed in green bold.
  • test1_score and test2_score are indicated by horizontal bars and are background-colorized: white (low score) to pink (high score)
  • final_score shows score and ranking. Top 3 are green, and others are gray.
  • registered texts are transformed to an icon and yes/no text.

formattable

The icon set used in the table is by GLYPHICONS.com and included in Bootstrap.

htmlwidget conversion in interactive environments

formattable will automatically convert to an htmlwidget when in an interactive() context such as the console or RStudio IDE. If you would like to avoid this conversion and see the html table output, please use format_table() that calls knitr::kable() with formatters or call format() with the formattable data.frame object.

License

This package is under MIT License.

More Resources
to explore the angular.

mail [email protected] to add your project or resources here 🔥.

Related Articles
to learn about angular.

FAQ's
to learn more about Angular JS.

mail [email protected] to add more queries here 🔍.

More Sites
to check out once you're finished browsing here.

0x3d
https://www.0x3d.site/
0x3d is designed for aggregating information.
NodeJS
https://nodejs.0x3d.site/
NodeJS Online Directory
Cross Platform
https://cross-platform.0x3d.site/
Cross Platform Online Directory
Open Source
https://open-source.0x3d.site/
Open Source Online Directory
Analytics
https://analytics.0x3d.site/
Analytics Online Directory
JavaScript
https://javascript.0x3d.site/
JavaScript Online Directory
GoLang
https://golang.0x3d.site/
GoLang Online Directory
Python
https://python.0x3d.site/
Python Online Directory
Swift
https://swift.0x3d.site/
Swift Online Directory
Rust
https://rust.0x3d.site/
Rust Online Directory
Scala
https://scala.0x3d.site/
Scala Online Directory
Ruby
https://ruby.0x3d.site/
Ruby Online Directory
Clojure
https://clojure.0x3d.site/
Clojure Online Directory
Elixir
https://elixir.0x3d.site/
Elixir Online Directory
Elm
https://elm.0x3d.site/
Elm Online Directory
Lua
https://lua.0x3d.site/
Lua Online Directory
C Programming
https://c-programming.0x3d.site/
C Programming Online Directory
C++ Programming
https://cpp-programming.0x3d.site/
C++ Programming Online Directory
R Programming
https://r-programming.0x3d.site/
R Programming Online Directory
Perl
https://perl.0x3d.site/
Perl Online Directory
Java
https://java.0x3d.site/
Java Online Directory
Kotlin
https://kotlin.0x3d.site/
Kotlin Online Directory
PHP
https://php.0x3d.site/
PHP Online Directory
React JS
https://react.0x3d.site/
React JS Online Directory
Angular
https://angular.0x3d.site/
Angular JS Online Directory