title: How can I divide the frequency of a factor by a fixed value in ggplot2 geom_bar?
body: <p>I want to divide all the values of bars in a geom_bar by a fixed value, to display the average value/week</p>
  
  <p>I have a list of attendance records, each showing the date, weekday, and the name of the error. I want to make a graph showing the average number of absences and tardy per weekday.</p>
  
  <p>Simplified version of my data for reproducing:</p>
  
  <pre><code>df &lt;- data.frame(
  
  date = c(2019-01-01,2019-01-01,2019-01-01,2019-01-02,2019-01-02,2019-01-02,2019-01-08,2019-01-09),
  
  weekday = c("Monday","Monday","Monday","Tuesday","Tuesday","Tuesday","Monday","Tuesday"),
  
  name = c("absent","absent","tardy","absent","tardy","tardy","absent","absent")
  )
  
  </code></pre>
  
  <p>Plotting what I have:</p>
  
  <pre><code>ggplot(df,aes(weekday)) + geom_bar(aes(fill = name))
  </code></pre>
  
  <p>This displays a plot showing the total number of absences and tardy on Monday and Tuesdays. 
  What I want to do is divide the total number by 2(the number of weeks), to show the average number of absent and tardy on each weekday.</p>