Quantcast
Channel: Active questions tagged r - Stack Overflow
Viewing all articles
Browse latest Browse all 201839

Labeling axis vertically in R [duplicate]

$
0
0

This question already has an answer here:

I have the following code that is plotting a barplot in R

barplot(prop.table(table(topPerforming$Category)))  #before

theTable <- within(topPerforming,Category <- factor(Category, levels=names(sort(table(Category),decreasing=TRUE))))
#theTable ---- new table created in which Category is sorted in decreasing manner.
#topPerforming ---- name of the old table. 
#Category ---- column name
#levels thing used to sort the names in the decreasing manner.

barplot(prop.table(table(theTable$Category)))

but the output plot i can only see 6 categories as they are overlapping each other (horizontally). I have tried las=2 as seen in similar questions on this but i keep getting errors.

Any ideas?current barplot


Viewing all articles
Browse latest Browse all 201839

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>