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

Popular posts from this blog

c++ - llvm function pass ReplaceInstWithInst malloc -

Cross-Compiling Linux Kernel for Raspberry Pi - ${CCPREFIX}gcc -v does not work -

java.lang.NoClassDefFoundError When Creating New Android Project -