PaginateAggs: Paginate aggs

Description Usage Arguments Examples

View source: R/pawr.R

Description

Send multiple queries to pushshift.io to get all available information for your request. This function is meant to get around the maximum of 1000 items returned by a single aggs query.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
PaginateAggs(
  type = c("comment", "submission", "subreddit"),
  aggs = c("author", "link_id", "created_utc", "subreddit"),
  paginate_by = c("date", "author"),
  before = round(as.numeric(Sys.time())),
  after = NULL,
  timescope = NULL,
  verbose = getOption("PAWR.VerbosePaginate"),
  ...
)

Arguments

type

Type of requested content. Can be comment, submission, or subreddit.

aggs

What should be aggregated over?

paginate_by

Define which variable should be used to break the data into smaller chunks; either author or date.

verbose

Should output be verbose? Defaults to a global option which can be set with options(PAWR.VerbosePaginate=TRUE/FALSE).

...

Other valid parameters. Run PSParams() to see all valid parameters and their descriptions.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
#Find out on which subreddits the users of r/cheese post
#Analysis is limited to December 2019
users<-PaginateAggs(aggs="author",paginate_by="date",
  subreddit="cheese",timescope=30*24*60*60,before=1577836800)
users<-users$key
#remove bots and missing values
users<-users[!(users %in% c("[deleted]","AutoModerator"))]
#Posting behavior of all authors is aggregated.
subreddits<-PaginateAggs(aggs="subreddit",paginate_by="author",
  author=users,timescope=30*24*60*60,before=1577836800)

Spiritspeak/PAWR documentation built on March 21, 2021, 4:14 p.m.