我正在尝试创建一个加权散点图,其中星期几在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类。
如何在没有错误的情况下创建此图?