r - Barplots with column names -
i have dataset :
dat<-read.table(text = "pl freq abid 23 berl 54 cara 54 daka 10",header=t)
i trying have histogram name of each columns (under columns (i.e. "pl" informations) , columns sorted in decreasing order... tried lot of ordering method, :
barplot(dat$freq)
seems not way...
i have idea helpfull !
cheers,
r.
i beieve looking for:
barplot(dat$freq, names.arg = dat$pl)
and if want have barplot sorted according frequencies:
dat <- dat[order(dat$freq, decreasing = true), ]
thomas
Comments
Post a Comment