I am trying to create a weighted scatter plot where the day of the week is on the Y-axis and the hour of the day is on the X-axis, with size = n of tweets. I have the following code:
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
The variable created_at is of class POSIXct and POSIXt.
How do I create this plot without the error?