1
dput(df)
structure(list(Month = structure(c(15248, 15522), class = "Date"),
Value = c(1, 3)), .Names = c("Month", "Value"), row.names = 1:2, class = "data.frame")
ggplot(df, aes(Month, Value)) +
geom_bar(fill = "orange", size = .3, stat = "identity", position = "identity") +
geom_smooth(data = df, aes(Month, Value, group = 1), method = "lm",
size = 2, color = "red") +
scale_x_date(breaks = "1 month", labels = date_format("%b-%Y"),
limits = as.Date(c('2011-01-01','2013-01-01')))
ggplot中的酒吧也超过了其他日期。我得到这个警告信息:ggplot酒吧正越过其他不属于的日期
Warning message:
In qt((1 - level)/2, df) : NaNs produced
有没有办法将bin放到所属日期,而不是交叉到其他日期?
非常感谢你 – user1471980
我想一个解决方案,将是有条件的将是巨大的替代
。 –