botscan: botscan

Description Usage Arguments Details Value Author(s) Examples

View source: R/botscan.R

Description

Scans Twitter Conversations For Bots

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
botscan(
  x = "#rstats",
  external_data = NA,
  timeout = 30,
  threshold = NA,
  api = "stream",
  n_tweets = 1000,
  retweets = FALSE,
  parse = TRUE,
  verbose = TRUE
)

Arguments

x

A string representing a Twitter search query, in quotation marks.

external_data

An optional dataframe with variable 'screen_name', containing Twitter handles, for example, from a conversation. By default, 'botscan' collects tweets and creates such a data frame. If 'external_data' is set, then 'x' is ignored.

timeout

A number representing the number of seconds the user wishes to stream tweets on the given search term. This is only applied when using the default STREAM Twitter API. Default is 30 seconds.

threshold

An optional number between zero and one that determines which botometer probability threshold to return. Default is missing (no threshold). If specified, only users estimated to be more likely than the threshold will be regarded as a bot.

api

A string specifying which Twitter API to collect data from, the "stream" or "search" API. Defaults to "stream".

n_tweets

A number representing how many tweets to extract.

retweets

A logical specifying whether to include retweets in the set of tweets to be extracted. Defaults to FALSE.

parse

A logical specifying whether to automatically parse data into structured data when querying the streaming API. Defaults to TRUE, making results more usable for most users. Setting to FALSE will produce less structured data but allow for faster processing for very large data projects.

verbose

A logical that determines whether to print periodic progress updates.

Details

botscan() takes a Twitter query and produces the proportion of the conversation and the users within that conversation that are likely to be bots.

To get a sample of tweets from the stream API, set x = "".

The api argument defaults to "stream", using Twitter's streaming API and collecting tweets which post after the function is called. The other option, "search", uses Twitter's search API, collecting tweets which posted before the function was called.

Value

A list of length 3:

Author(s)

Kurt Wirth and Ryan T. Moore

Examples

1
2
3
4
5
## Not run: botscan("#rtweets")
## Not run: botscan("biden")

## The above examples fail unless you have created and installed Twitter 
## tokens, per instructions provided at http://rtweet.info/articles/auth.html.

kurtawirth/botscan documentation built on June 17, 2021, 12:30 a.m.