#rprogramming #datavisualization #barplot #barcharts #dplyr #barcharts
In this video I have described how to get barplot and label the bars with the values. I have discussed also how to summarize data to get barplots.
facebook page:
https://www.facebook.com/RajendraChoureISC
Mail Id:
[email protected]
youtube playlist:
https://youtube.com/playlist?list=PLfAzV0jqypOhtjvLvYyMG-6_viNCKLLXP
#script
a= c(24, 27,29,15)
b = letters[1:4]
bp = barplot(a,names.arg = b, ylim=c(0, 33), col= terrain.colors(4))
text(x=bp,y=a+2, labels = b)
bp
Orange
Orange$age=factor(Orange$age)
str(Orange)
library(dplyr)
Orange_sum = group_by(Orange ,age )
Orange_sum= summarise(Orange_sum, mean_circ = mean(circumference))
obp = barplot(Orange_sum$mean_circ,names.arg = Orange_sum$age,ylim=c(0,190), las=2,col=terrain.colors(7))
text(x=obp, y=Orange_sum$mean_circ+10,labels =Orange_sum$mean_circ )
obp
Download
0 formats
No download links available.
How to make and enahnce nice labeled barplot using base R plotting | NatokHD