## 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"
#
# ## count all tweets in the database
# count.tweets(set)
#
# ## count tweets that mention the word 'turkey'
# count.tweets(set, string="turkey")
#
# ## count tweets that mention the words 'turkey' and 'gezi'
# count.tweets(set, string=c("turkey", "gezi"))
#
# ## count all retweets in the database
# count.tweets(set, retweets=TRUE)
#
# ## count all tweets that mention 'turkey' and are not retweets
# count.tweets(set, string="turkey", retweets=FALSE)
#
# ## count all tweets that use a hashtag
# count.tweets(set, hashtags=TRUE)
#
# ## count all tweets from January 1st to January 15th
# count.tweets(set, from="2014-01-01 00:00:00", to="2014-01-15 23:59:59")
# ## End(Not run)
Run the code above in your browser using DataLab