Summary Table - formatting the numbers

Hello,

I am fairly new to R Studio. I am trying to make a summary table that formats the numbers.
Year Net.Sales Q Q1 Q2 Q3 Q4

1 1995 195027 Q1 1 0 0 0
2 1995. 161864 Q2 0 1 0 0
3 1996. 167601 Q3 0 0 1 0
4 1996. 171442 Q4 0 0 0 1
5 1996 244986 Q1 1 0 0 0
6 1996. 203912 Q2 0 1 0 0
7 1996. 213402 Q3 0 0 1 0
8 1997. 229798 Q4 0 0 0 1
9 1997 312584 Q1 1 0 0 0
10 1997. 259800 Q2 0 1 0 0

I am just using the summary(quarterly1) code currently.

summary(quarterly1)
Year Net.Sales Q Q1 Q2
Min. :1995.0 Min. : 161864.0 Length:88 Min. :0.00 Min. :0.00
1st Qu.:2000.0 1st Qu.: 441501.2 Class :character 1st Qu.:0.00 1st Qu.:0.00
Median :2005.5 Median :1301268.5 Mode :character Median :0.00 Median :0.00
Mean :2005.5 Mean :1605965.5 Mean :0.25 Mean :0.25
3rd Qu.:2011.0 3rd Qu.:2509666.8 3rd Qu.:0.25 3rd Qu.:0.25
Max. :2016.0 Max. :4829000.0 Max. :1.00 Max. :1.00
Q3 Q4
Min. :0.00 Min. :0.00
1st Qu.:0.00 1st Qu.:0.00
Median :0.00 Median :0.00
Mean :0.25 Mean :0.25
3rd Qu.:0.25 3rd Qu.:0.25
Max. :1.00 Max. :1.00

The numbers are unformatted in the table. Is there a way to add a dollar sign or a comma for Net.Sales?

I tried the quarterly1$Net.Sales=format_dollars(quarterly1$Net.Sales) before running the summary, but that did not work.

Thanks in advance

Hi!

To help us help you, could you please prepare a reproducible example (reprex) illustrating your issue? Please have a look at this guide, to see how to create one:

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.