I am working with the 'mtcars' dataset and have made this bar plot for the 'cyl' column:
For the y-axis, i want to see percentage instead of count. Is that possible?
Load the 'scales' package first, which gives different attributes to alter your scales.
Now, the below command is what you need:
ggplot(data = mtcars,aes(x=factor(cyl)))+geom_bar()+scale_y_continuous(labels=percent)
how to change the order of legend ...READ MORE
R provides 3 basic indexing operators. Refer ...READ MORE
You can use mtabulate in the following way:
cbind(data, ...READ MORE
You can use the plyr function:
data <- ...READ MORE
By Using gridExtra library we can easily ...READ MORE
You can use the theme layer to ...READ MORE
The below command will give you the ...READ MORE
How to plot different line graphs for ...READ MORE
You can use the scale_x_discrete() function with ...READ MORE
You just have to add 'outlier.shape=NA' inside ...READ MORE
Already have an account? Sign in.