pillar (version 1.2.3)

format_type_sum: Format a type summary

Description

Called on values returned from type_sum() for defining the description in the capital. Implement this method for a helper class for custom formatting, and return an object of this helper class from your type_sum() implementation. See examples.

Usage

format_type_sum(x)

# S3 method for default format_type_sum(x)

Arguments

x

A return value from type_sum()

Examples

Run this code
# NOT RUN {
format_type_sum(1)
pillar(1)

type_sum.accel <- function(x) {
  structure("kg m/s^2", class = "type_sum_accel")
}
format_type_sum.type_sum_accel <- function(x) {
  style_subtle(x)
}
accel <- structure(9.81, class = "accel")
pillar(accel)
# }

Run the code above in your browser using DataCamp Workspace