inst/tinytest/test-datasummary_df.R

# TODO: add_columns

tmp <- head(mtcars)

# no error + code coverage
tmp$cyl <- as.factor(tmp$cyl)

ar <- tail(mtcars, 1)
ac <- data.frame(new = 1:6)

tab <- datasummary_df(
    data = tmp,
    output = "default",
    fmt = "%.0f",
    align = strrep("r", ncol(tmp)),
    hrule = 3,
    title = "blah blah title",
    notes = c("first note", "second note"),
    add_rows = ar)
expect_inherits(tab, "kableExtra")

Try the modelsummary package in your browser

Any scripts or data that you put into this service are public.

modelsummary documentation built on Oct. 15, 2023, 5:06 p.m.