Learn R Programming

smappR (version 0.5)

plot.tweets: Plots number of tweets by hour or minute

Description

Plots number of tweets by hour or minute

Usage

"plot"(tweets, breaks = "hours", return_plot = FALSE, missing_minutes = FALSE, hours = 0)

Arguments

tweets
object of class tweets
breaks
either "minutes" or "hours"
return_plot
If TRUE, function returns plot as an object (useful when saving to a file.)
missing_minutes
If TRUE, minutes with zero tweets in the plot where breaks is minutes will be interpolated.
hours
numeric. When different from zero, will add that number of hours to the timestamp of the tweets. That is, when hours is zero, then all times are expressed in NY time.

Examples

Run this code
## Not run: 
# ## connect to the Mongo database
#  mongo <- mongo.create("SMAPP_HOST:PORT", db="DATABASE")
#  mongo.authenticate(mongo, username="USERNAME", password="PASSWORD", db="DATABASE")
#  set <- "DATABASE.COLLECTION"
# 
# ## extract all tweets that mention 'occupygezi' and do a quick plot
#  tweets <- extract.tweets(set, string="occupygezi", fields="created_at")
#  plot(tweets)
# ## End(Not run)

Run the code above in your browser using DataLab