format_type_sum | R Documentation |
Called on values returned from type_sum()
for defining the description
in the capital.
format_type_sum(x, width, ...)
## Default S3 method:
format_type_sum(x, width, ...)
## S3 method for class 'AsIs'
format_type_sum(x, width, ...)
x |
A return value from |
width |
The desired total width. If the returned string still is
wider, it will be trimmed. Can be |
... |
Arguments passed to methods. |
Two methods are implemented by default for this generic: the default method,
and the method for the "AsIs"
class.
Return I("type")
from your type_sum()
implementation to format the type
without angle brackets.
For even more control over the formatting, implement your own method.
# Default method: show the type with angle brackets
format_type_sum(1, NULL)
pillar(1)
# AsIs method: show the type without angle brackets
type_sum.accel <- function(x) {
I("kg m/s^2")
}
accel <- structure(9.81, class = "accel")
pillar(accel)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.