dm_set_table_description {dm} | R Documentation |
Add info about a dm's tables
Description
When creating a diagram from a dm
using dm_draw()
the table descriptions set with dm_set_table_description()
will be displayed.
Usage
dm_set_table_description(dm, ...)
dm_get_table_description(dm, table = NULL, ...)
dm_reset_table_description(dm, table = NULL, ...)
Arguments
dm |
A |
... |
For For |
table |
One or more table names, unquoted, for which to
In both cases the default applies to all tables in the |
Details
Multi-line descriptions can be achieved using the newline symbol \n
.
Descriptions are set with dm_set_table_description()
.
The currently set descriptions can be checked using dm_get_table_description()
.
Descriptions can be removed using dm_reset_table_description()
.
Value
For dm_set_table_description()
: A dm
object containing descriptions for specified tables.
For dm_get_table_description
: A named vector of tables, with the descriptions in the names.
For dm_reset_table_description()
: A dm
object without descriptions for specified tables.
Examples
desc_flights <- rlang::set_names(
"flights",
paste(
"On-time data for all flights",
"that departed NYC (i.e. JFK, LGA or EWR) in 2013.",
sep = "\n"
)
)
nyc_desc <- dm_nycflights13() %>%
dm_set_table_description(
!!desc_flights,
"Weather at the airport of\norigin at time of departure" = weather
)
nyc_desc %>%
dm_draw()
dm_get_table_description(nyc_desc)
dm_reset_table_description(nyc_desc, flights) %>%
dm_draw(font_size = c(header = 18L, table_description = 9L, column = 15L))
pull_tbl(nyc_desc, flights) %>%
labelled::label_attribute()