title: How to round numbers used in ggplot in R
body: <p>First is the sample data and manipulations and then the code that im using to create the horizontal bar chart. Everything works fine except that I can't figure out how to round the numbers used in the data labels. First, how does round the number in the data label. I used the following &quot;scale_y_continuous(labels = scales::comma, accuracy=1)&quot; and appended it to what I have but got errors due to the comma next to accuracy. Also, tried a mutate (and round command) in the data frame but that was unsuccessful. Any ideas on how best to accomplish this?</p>
  <pre><code>    A&lt;- c(150.333,125.888,0,-300.5555,-350.444,-370.99999)
      Series&lt;- c(&quot;Construction&quot;,&quot;Manufacturing&quot;,&quot;Information&quot;,&quot;Health_Care&quot;,&quot;Education&quot;,&quot;Government&quot;)
  
      testdf &lt;- data.frame(A,Series)
  
      ggplot(data = testdf, aes(y = A, x = reorder(Series, A))) +
      geom_col(color = &quot;blue&quot;) +
      coord_flip() +
      scale_y_continuous(expand = expansion(mult = 0.5)) +
      geom_text(aes(label = A, hjust = ifelse(A &gt; 0, 0, 1), y = A + ifelse(A &gt; 0, 10, -10))) +
      labs(x = NULL) +
      ggtitle(&quot;Job Growth&quot;) +
      theme(
      plot.title.position = &quot;plot&quot;,
      plot.title = element_text(hjust = 0.5)
       )
  </code></pre>
  <p>tried this as well. No errors but the plot does not change.</p>
  <pre><code>jobgrowth&lt;- ggplot(data = testdf, aes(y = A, x = reorder(Series, A))) +
  geom_col(color = &quot;blue&quot;) +
  coord_flip() +
  scale_y_continuous(label = scales::comma(A, accuracy=1),expand = 
  expansion(mult = 0.5)) +
  geom_text(aes(label = A, hjust = ifelse(A &gt; 0, 0, 1), y = A + ifelse(A &gt; 0, 
  10, -10))) +
  labs(x = NULL) +
  ggtitle(&quot;Job Growth&quot;) +
  theme(
    plot.title.position = &quot;plot&quot;,
    plot.title = element_text(hjust = 0.5)
  )
  </code></pre>