Collect comments data from reddit threads
Source:R/Collect.thread.reddit.R
, R/zzz.R
Collect.thread.reddit.Rd
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 class 'thread.reddit'
Collect(
credential,
endpoint,
threadUrls,
sort = NA,
waitTime = c(6, 8),
ua = getOption("HTTPUserAgent"),
...,
writeToFile = FALSE,
verbose = TRUE
)
collect_reddit_threads(
threadUrls,
sort = "best",
waitTime = c(6, 8),
ua = vsml_ua(),
writeToFile = FALSE,
verbose = TRUE,
...
)
Arguments
- credential
A
credential
object generated fromAuthenticate
with class name"reddit"
.- endpoint
API endpoint.
- threadUrls
Character vector. Reddit thread urls to collect data from.
- sort
Character vector. Reddit comment sort order. Options are
"best"
,"top"
,"new"
,"controversial"
,"old"
, and"qa"
. Default isNA
.- waitTime
Numeric vector. Time range in seconds to select random wait from in-between url collection requests. Minimum is 3 seconds. Default is
c(6, 8)
for a wait time chosen from between 6 and 8 seconds.- ua
Character string. Override User-Agent string to use in Reddit thread requests. Default is
option("HTTPUserAgent")
value as set by vosonSML.- ...
Additional parameters passed to function. Not used in this method.
- writeToFile
Logical. Write collected data to file. Default is
FALSE
.- verbose
Logical. Output additional information about the data collection. Default is
TRUE
.