Learn R Programming

ezsummary (version 0.1.9)

ezmarkup: Easy way to "markup" a table before it is sent to be displayed

Description

The final step of an analysis is to export the tables generated through analytical scripts to the desired platform, such as a pdf, a rmarkdown document or even a Shiny page. Sometimes, a lot of people wants to reorganize the data in a more human readable format. For example, people like to put the standard deviation inside a pair of parentheses after the mean. People also like to put the low and high ends of confidence interval inside a pair of parenthese, separated by " ~ ", after the estimated average. However, as far as I know, so far there isn't a straight forward function to deal with this need. This function is built to address this issue.

Usage

ezmarkup(tbl, pattern)

Arguments

Examples

Run this code
library(dplyr)
dt <- mtcars %>% group_by(cyl) %>% select(gear, carb) %>% ezsummary_categorical(n=TRUE)

ezmarkup(dt, "...[.(.)]")
ezmarkup(dt, "..[. (. ~ .)]")

Run the code above in your browser using DataLab