在y轴上绘制星期几,在x轴上绘制小时

时间:2017-09-08 17:02:51

标签: r ggplot2 dplyr

我正在尝试创建一个加权散点图,其中星期几在Y轴上,一天中的小时在X轴上,其中size = n的推文。我有以下代码:

data %>%
mutate(day_week = wday(created_at)) %>%
count(screen_name, hour = hour(with_tz(created_at, "CET"))) %>%
ggplot(aes(day_week, hour, size = n)) +
geom_point() +
labs(x = "Hour of day (CET)",
   y = "Day of the week") + theme_bw()

Error in FUN(X[[i]], ...) : object 'day_week' not found

变量created_at属于POSIXct和POSIXt类。

如何在没有错误的情况下创建此图?

0 个答案:

没有答案