November 21, 2018

R Barchart

if (!require(ggplot2)) install.packages('ggplot2')
library(ggplot2)

...
ggplot(
  data=somedata,
  aes(x=mth_end_dt, y=col3/1000000, colour=col2)
) +
 geom_bar (stat="identity", width = 10.0, position = position_dodge(width = 10.0)) +
 
xlab("Month") +
ylab("Trend") +
scale_x_date(
  date_breaks = "1 month"
)

No comments:

Post a Comment