Learn R Programming

vosonSML (version 0.26.3)

Collect.reddit: Collect comments data from reddit threads

Description

Collects comments made by users on one or more specified subreddit conversation threads and structures the data into a dataframe with the class names "datasource" and "reddit".

Usage

# S3 method for reddit
Collect(credential, threadUrls, waitTime = 5,
  writeToFile = FALSE, ...)

Arguments

credential

A credential object generated from Authenticate with class name "reddit".

threadUrls

Character vector. Reddit thread urls to collect data from.

waitTime

Numeric integer. Time in seconds to wait in-between url collection requests.

writeToFile

Logical. Write collected data to file. Default is FALSE.

...

Additional parameters passed to function. Not used in this method.

Value

A data.frame object with class names "datasource" and "reddit".

Examples

Run this code
# NOT RUN {
# subreddit url to collect threads from
threadUrls <- c("https://www.reddit.com/r/xxxxxx/comments/xxxxxx/x_xxxx_xxxxxxxxx/")

redditData <- redditAuth %>%
  Collect(threadUrls = threadUrls, waitTime = 3, writeToFile = TRUE)
# }
# NOT RUN {
# }

Run the code above in your browser using DataLab