How do I fix the scale of the graph in R. looking at the x axis not all value is available as in the csv column for total accident case. I'm writing the simple code as below.
>barplot(table(try_$`Total Accident (K)`))
How do I fix the scale of the graph in R. looking at the x axis not all value is available as in the csv column for total accident case. I'm writing the simple code as below.
>barplot(table(try_$`Total Accident (K)`))
R is actually doing exactly what you told it to do. You're asking it to plot the frequency distribution of total accidents, but my guess is that total accidents is unique for every observation. I think if you did barplot(try_$`Total Accident (K)`))
that would give you closer to what you want.
use this code
library(ggplot2)
ggplot(aes(x=`Total Accident (K)`), data = try_) + geom_bar()