Frequency density barplot of categorical variable
问题 I'd like to plot a barplot of frequency density of the following ordered categorical data: summary(ACC[EA$TYPE=="A"]) NG SG LG MG HG 2 25 36 17 0 If I plot: plot(ACC[EA$TYPE=="A"]) I get: But I'd like to divide all the values by the total to get a frequency density: Ie. plot(ACC[EA$TYPE=="A"]/sum(as.numeric(ACC[EA$TYPE=="A"]))) but that doesn't work. Any tips? Cheers, 回答1: The default plotting function for a factor is barplot . So if you want a different graph, it may be easier to directly