Create a simple number vector
df = c(123454, 39384894, 123)
Use Pretty number to have the output breakout with commas
prettyNum(df,big.mark=",",scientific=FALSE)
## [1] "123,454" "39,384,894" "123"
Same output using format
format(df,big.mark=",",scientific=FALSE, trim = TRUE)
## [1] "123,454" "39,384,894" "123"
Same output using scales package
library(scales)
comma(df)
## [1] "123,454" "39,384,894" "123"
add usd sign to output
sprintf("$ %3.2f", df)
## [1] "$ 123454.00" "$ 39384894.00" "$ 123.00"
Change number to a percentage
x <- c(0.65, 0.05, 0.99)
sprintf("%.1f %%", 100*x)
## [1] "65.0 %" "5.0 %" "99.0 %"