Learn R Programming

rtweet (version 0.6.9)

get_collections: Get collections by user or status id.

Description

Find collections (themed grouping of statuses) created by specific user or status id. Results include user, status, and collection features.

Usage

get_collections(user, status_id = NULL, n = 200, cursor = NULL,
  parse = TRUE, token = NULL)

Arguments

user

Screen name or user id of target user. Requests must provide a value for one of user or status_id.

status_id

Optional, the identifier of the tweet for which to return results. Requests must provide a value for one of user or status_id.

n

Maximum number of results to return. Defaults to 200.

cursor

Page identifier of results to retrieve. If parse = TRUE, the next cursor value for any given request--if available--is stored as an attribute, accessible via next_cursor

parse

Logical indicating whether to convert response object into nested list. Defaults to true.

token

Every user should have their own Oauth (Twitter API) token. By default token = NULL this function looks for the path to a saved Twitter token via environment variables (which is what `create_token()` sets up by default during initial token creation). For instruction on how to create a Twitter token see the tokens vignette, i.e., `vignettes("auth", "rtweet")` or see ?tokens.

Value

Return object converted to nested list if parsed otherwise an HTTP response object is returned.

Examples

Run this code
# NOT RUN {
# }
# NOT RUN {
## lookup a specific collection
cnnc <- get_collections("cnn")

## inspect data
str(cnnc)

## by status id
wwe <- get_collections(status_id = "925172982313570306")

## inspect data
str(wwe)

# }
# NOT RUN {
# }

Run the code above in your browser using DataLab