ztable Update

Keon-Woong Moon

2018-05-14

Installation

You can install R package “ztable” from CRAN. Current version is 0.1.8.

install.packages("ztable")

You can install the developmental version of ztable from github. Current github version is 0.1.9.

if(!require(devtools)) install.packages("devtools")
devtools::install_github("cardiomoon/ztable")

Make table from a data.frame

Package “ztable” make everything possible about table. Basically, An object of “ztable” made from a data.frame. The default output format of ztable is RStudio::viewer or web-browser format(type=“viewer”). So if you want to use ztable in a “html” format, you should change the parameter ztable.type to “html”. If you want to use ztable in latex format, you should change the parameter ztable.type to “latex”.

library(ztable)
library(magrittr)
options(ztable.type="html")
z=ztable(head(iris),caption="Table 1. Basic Table")
z
Table 1. Basic Table
  Sepal.Length Sepal.Width Petal.Length Petal.Width Species
1 5.10 3.50 1.40 0.20 setosa
2 4.90 3.00 1.40 0.20 setosa
3 4.70 3.20 1.30 0.20 setosa
4 4.60 3.10 1.50 0.20 setosa
5 5.00 3.60 1.40 0.20 setosa
6 5.40 3.90 1.70 0.40 setosa

You can see the full vignette here:

  1. ztable vignette: https://cran.r-project.org/web/packages/ztable/vignettes/ztable.html

  2. ztable update: http://rpubs.com/cardiomoon/388645