knitr::opts_chunk$set( collapse = TRUE, comment = "#>", fig.path = "man/figures/README-", out.width = "100%" )
knitr::include_graphics("man/figures/rawrr.jpg")
This package gives you access to Reddit's API in order to gather information on threads, subreddits, and users.
Under the hood, it calls Python's PRAW library via the reticulate package.
RAWRR stands for Reddit API Wrapper for R using Reticulate ;)
You can install the development version from GitHub with:
# install.packages("devtools") devtools::install_github("acastroaraujo/rawrr")
It currently has these functions:
install_praw()
: A simple wrapper for the following:
reticulate::py_install("praw", method = "auto", conda = "auto", pip = TRUE)
init_reddit(username, password, client_id, client_secret)
download_sub_urls()
: Downloads urls by subreddit
download_keyword_urls()
: Downloads urls by search query
extract_thread()
: Extracts a thread from a path
add_threads()
Adds thread information to a data frame, like the one produced by the download_*_urls()
functions
create_aff_net()
: Creates a bipartite network of users and recent subreddits from a list of users
user_net()
: Creates an edge list (i.e. a network) of user interactions from a data frame, like the one produced by add_threads()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.