How to Create Bar Chart in R Programming

  1. # Create the data for the chart.  
  2. B <- c(73,28,41,12)  
  3.   
  4. #  chart file a name.  
  5. png(file = "mychart.png")  
  6.   
  7. # Plot the bar chart.  
  8. barplot(B)  
  9.   
  10. # Save  file.  
  11. dev.off()