A fn for info_snippet(): get an inline statistical summary
A fn for info_snippet(): get an inline statistical summary
The snip_stats() function can be used as an info_snippet() function (i.e., provided to fn) to produce a five- or seven-number statistical summary. This inline summary works well within a paragraph of text and can help in describing the distribution of numerical values in a column.
For a given column, three different types of inline statistical summaries can be provided:
a five-number summary ("5num"): minimum, Q1, median, Q3, maximum
snip_stats(column, type = c("5num","7num","bowley"))
Arguments
column: The target column
scalar<character> // required
The name of the column that contains the target values.
type: Type of statistical summary
singl-kw:[5num|7num|bowley] // default:"5num"
The type of summary. By default, the "5num" keyword is used to generate a five-number summary. Two other options provide seven-number summaries: "7num" and "bowley".
Returns
A formula needed for info_snippet()'s fn argument.
Examples
Generate an informant object, add a snippet with info_snippet() and snip_stats() (giving us a method to get some summary stats for column d). Define a location for the snippet result in { } and then incorporate()
the snippet into the info text. Note here that the order of the info_columns() and info_snippet() calls doesn't matter.