Tagged "currencies"

Formatting Currencies in R

Here are a few different ways to format numbers in R. A few of theme can be accomplished using the paste function in R. I’ve found that there are a few different methods to do this. Using the scales package Using the scales packages from Hadley, there is a great function with various options including passing a vector. library(scales) dollar_format()(c(-100, 0.23, 1.456565, 2e3)) ## [1] "-$100.00" "$0.23" "$1.46" "$2,000.