Monday, December 13, 2021

Bar chart in R language

# defining vector

x <- c(7, 15, 23, 12, 44, 56, 32)


# output to be present as PNG file

png(file = "barplot.png")


# plotting vector

barplot(x, xlab = "GeeksforGeeks Audience",

        ylab = "Count", col = "white",

        col.axis = "darkgreen",

        col.lab = "darkgreen")


# saving the file

dev.off()



references:-https://www.geeksforgeeks.org/r-charts-and-graphs/

https://www.javatpoint.com/r-bar-charts 

No comments:

Post a Comment