I have a data frame with tweets (containing a timecode, tweet-id, text, etc.) and want to visualise the amount of tweets per hour. It works fine with a bar graph:
I use the following code to produce the bar graph (created stores the timecode of a tweet in POSIX format):
ggplot(data=tweets_frame, aes(x=created)) +
geom_bar(aes(fill=..count..), binwidth=3600) +
scale_x_datetime("Time") +
scale_y_continuous("Tweets")
I want to produce the same graph, but as line graph instead of as bar graph.
I tried to just replace geom_bar with geom_line:
ggplot(data=tweets_frame, aes(x=created)) +
geom_line(aes(fill=..count..), binwidth=3600) +
scale_x_datetime("Time") +
scale_y_continuous("Tweets")
Which resulted in this error message:
Error in eval(expr, envir, enclos) : object 'count' not found
I cannot figure out how to specify the ..count.. in a line graph.

dput(tweets_frame)(or part of it) in the examplecreatedcolumn, that contains a posix timestamp, and then columns for the text of the tweet, tweet-id, screenname of author, etc... I can upload a sample later, but the question is general and not specific to the data.ggplot(data=mtcars, aes(x=hp)) + geom_line(aes(fill=..count..), stat="bin", binwidth=10)?stat="bin", and I also found that By default,geom_barusesstat="bin"andgeom_linedoes not. That's why I did not think about it. Do you want to add your comment as an answer, @Jota.