# NOT RUN {
# Create a pointblank `informant`
# object with `create_informant()`;
# we specify a `read_fn` with the
# `~` followed by a statement that
# gets the `small_table` dataset
informant <-
create_informant(
read_fn = ~ small_table,
tbl_name = "small_table",
label = "An example."
)
# The `informant` object has the 'table'
# and 'columns' sections; we can add more
# properties to individual columns in
# the 'columns' section
informant <-
informant %>%
info_columns(
columns = vars(a),
info = "In the range of 1 to 10. (SIMPLE)"
) %>%
info_columns(
columns = starts_with("date"),
info = "Time-based values (e.g., `Sys.time()`)."
) %>%
info_columns(
columns = "date",
info = "The date part of `date_time`. (CALC)"
)
# Upon printing the `informant` object, we see
# the additions made to the 'Columns' section
# The `informant` object can be written to
# a YAML file with the `yaml_write()`
# function; then, information can
# be directly edited or modified
# yaml_write(
# informant = informant,
# filename = "informant.yml"
# )
# The YAML file can then be read back
# into an informant object with the
# `yaml_read_informant()` function
# informant <-
# yaml_read_informant(path = "informant.yml")
# }
Run the code above in your browser using DataLab