Learn R Programming

pointblank (version 0.6.0)

info_tabular: Add information that focuses on aspects of the data table as a whole

Description

When an informant object is created with the create_informant() function, it has two starter sections: (1) 'table' and (2) 'columns'. The 'table' section should contain a few properties upon creation, such as the supplied table name (name) and table dimensions (as _columns and _rows). We can add more table-based properties with the info_tabular() function. By providing a series of named arguments (in the form entry_name = "The *info text*."), we can add more information that makes sense for describing the table as a whole.

Usage

info_tabular(x, ...)

Arguments

x

An informant object of class ptblank_informant.

...

Information entries as a series of named arguments. The names refer to subsection titles within the TABLE section and the RHS is the info text (informational text that can be written as Markdown and further styled with Text Tricks).

Value

A ptblank_informant object.

Figures

Function ID

3-1

Details

The info text readily accepts Markdown formatting. Also, there are a few Text Tricks that are good to know. Markdown links written as < link url > or [ link text ]( link url ) will get nicely-styled links. Any dates expressed in the ISO-8601 standard with parentheses, "(2004-12-01)", will be styled with a font variation (monospaced) and underlined in purple. Spans of text can be converted to label text by using: (1) double parentheses around text for a rectangular label as in ((label text)), or (2) triple parentheses around text for a rounded-rectangular label like (((label text))). Finally, CSS styles can be applied to spans of info text with the following form:

[[ info text ]]<< CSS style rules >>

As an example of this in practice suppose you'd like to change the color of some text to red and make the font appear somewhat thinner. A variation on the following might be used:

"This is a [[factor]]<<color: red; font-weight: 300;>> value."

See Also

Other Information Functions: info_columns(), info_section(), info_snippet()

Examples

Run this code
# 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 the 'table' section
informant <-
  informant %>%
  info_tabular(
    row_definition = "A row has randomized values.",
    source = c(
      "- From the **pointblank** package.",
      "- [https://rich-iannone.github.io/pointblank/]()"
     )
   )

# Upon printing the `informant` object, we see
# the additions made to the 'Table' 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