context("test-column-modification")
test_that("supplied nr. of columnames equals nr. of columns",{
df <- tibble::tibble(x = 1:2, y = 3:4)
expect_error(print_df(df, colnames = c("eins")))
})
test_that("column-width modification works",{
df <- tibble::tibble(x = 1:2, y = 3:4)
expect_match(
print_df(df, output = "pdf", modify_these_columns = c("x"), column_widths = c("8 cm")),
"8 cm"
)
expect_match(
print_df(df, output = "pdf", modify_these_columns = c("x", "y"), column_widths = c("4 cm")),
"4 cm"
)
})
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.