Learn R Programming

needmining (version 0.1.1)

downloadTweets: Downloading Tweets based on a keyword list

Description

downloadTweets downloads Tweets containing specified keywords from the Twitter API

Usage

downloadTweets(search_terms, n = 100, lang = "en")

Arguments

search_terms

a string containing the search terms in Twitter format (use OR and AND to connect multiple search terms in one search)

n

The number of Tweets downloaded. Please note that this limit is based on your Twitter account

lang

The language of the Tweets. Default is English. Please refer to the Twitter API documentation for language codes

Value

a data frame containing the tweets as well as an additional column isNeed filled with 0

Details

This function downloads Tweets for a specified keyword list, removes line breaks, adds a column isNeed filled with 0

Examples

Run this code
# NOT RUN {
searchterm <- '"smart speaker" OR "homepod" OR "google home mini"'
# }
# NOT RUN {
token <- twitterLogin()
currentTweets <- downloadTweets(searchterm, n = 180)
# }

Run the code above in your browser using DataLab