View source: R/S03_Utilities.R
format_numbers | R Documentation |
Function that pads numeric values to be the same length by adding spaces to the left-hand side and trailing zeros after the decimal place.
format_numbers(x)
x |
A numeric vector. |
A character vector.
# Decimal values
message( paste0( format_numbers( round( rnorm( 3 ), 2 ) ), "\n" ) )
# Whole numbers
message( paste0( format_numbers( rbinom( 3, 100, .1 ) ), "\n" ) )
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.