Description Usage Arguments Author(s) Examples
extract.hashtags
opens a connection to the Mongo database in
the lab computer and returns a list of hashtags used in all tweets,
or in tweets that contain a given keyword. In combination with
summary.retweets
, this is a quick way to display the top
hashtags used in a collection of tweets.
1 2 |
set |
string, name of the collection of tweets in the Mongo database to query. |
text |
vector with tweets text. To be used when all other arguments
are |
string |
string or vector of strings, set to NULL by default (will return hashtags for all tweets). If it is a string, it will return all hashtags that were used in tweets containing that string. If it is a vector of strings, it will return all hashtags that were used in tweets containing at least one of the strings. |
from |
date, in string format. If different from |
to |
date, in string format. If different from |
verbose |
logical, default is |
Pablo Barbera pablo.barbera@nyu.edu
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | ## 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 hashtags in a collection of tweets
ht <- extract.hashtags(set)
## show top 10 hashtags
summary(ht, n=10)
## extract all hashtags that are used in tweets that mention "occupygezi"
ht <- extract.hashtags(set, string="occupygezi")
## show top 10 hashtags in tweets mentioning "occupygezi"
summary(ht, n=10)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.