Description Usage Arguments Details Value Author(s) References See Also Examples
Provide a scatterplot displaying hashtag counts overtime based on data obtained from Twitter.
1 | track_twitter_hashtag(keyword, type, number, sincetype, provideN)
|
keyword |
A character vector of maximum length 4 (keywords requested) |
type |
A character vector of length 1 (type of keyword, can
be either a city/place/monument name in English, to be referred to as
"place", or if needed another type of keyword, please specify by "other").
|
number |
A positive integer number (timeframe parameter) |
sincetype |
A character vector of length 1 (timeframe parameter), which can be (uniquely) on of the following: either "days", "weeks", "months" or "years" |
provideN |
A positive integer number (Number ot tweets to fetch per keywords) |
The function automatically obtains the latitude and longitude of
each requested place, then queries the Twitter API to obtain the number of
tweets with the requested # keywords for the desired timeframe, and returns
at the end a scatterplot based on the
aesthetics of ggplot2
,
allowing thus to analyze which places are the most popular
over a given time period.
It should be noted in that sense that if the time frame selected by the user
is less than or equal to 2 weeks, the plot returned groups data by hour,
whereas if the user requests longer timeframes the result will be grouped by
days for better representation of the changes over time
(short/long term).
Lastly, we advise the user to keep the parameter provideN
low
to avoid long delay responses from Twitter API (e.g. setting provideN=100
would be preferable than 1000).
A timeseries scatterplot with the hashtag count on the y axis, and on the x axis the timeframe.
A dataframe containing all the results fetched from Twitter
(e.g. tweets) based on package twitteR
Ayrton Rua: ayrton.gomesmartinsrua@unil.ch
Maurizio Griffo: maurizio.griffo@unil.ch
Ali Karray: mohamedali.karray@unil.ch
Mohit Mehrotra: mohit.mehrotra@unil.ch
Youness Zarhloul: youness.zarhloul@unil.ch
Orso, S., Molinari, R., Lee, J., Guerrier, S., & Beckman, M. (2018). An Introduction to Statistical Programming Methods with R. Retrieved from https://smac-group.github.io/ds/
1 2 3 4 5 6 7 8 9 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.