Learn R Programming

expss (version 0.11.6)

set_caption: Add caption to the table

Description

To drop caption use set_caption with caption = NULL. Captions are supported by htmlTable.etable, xl_write and as.datatable_widget functions.

Usage

set_caption(obj, caption)

get_caption(obj)

is.with_caption(obj)

Value

object of class with_caption.

Arguments

obj

object of class etable - result of cross_cpct and etc.

caption

character caption for the table.

Examples

Run this code

data(mtcars)
mtcars = apply_labels(mtcars,
                      vs = "Engine",
                      vs = num_lab("
                             0 V-engine 
                             1 Straight engine
                             "),
                      am = "Transmission",
                      am = num_lab("
                             0 Automatic 
                             1 Manual
                             ")
)
tbl_with_caption = cross_cases(mtcars, am, vs) %>% 
    set_caption("Table 1. Type of transimission.")
    
tbl_with_caption

Run the code above in your browser using DataLab