https://github.com/acastroaraujo/rawrr
reddit api wrapper for R
https://github.com/acastroaraujo/rawrr
Last synced: 4 months ago
JSON representation
reddit api wrapper for R
- Host: GitHub
- URL: https://github.com/acastroaraujo/rawrr
- Owner: acastroaraujo
- License: other
- Created: 2020-05-26T05:09:32.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2020-08-19T22:04:27.000Z (over 4 years ago)
- Last Synced: 2024-08-13T07:14:06.389Z (8 months ago)
- Language: R
- Size: 881 KB
- Stars: 4
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.Rmd
- License: LICENSE
Awesome Lists containing this project
- jimsghstars - acastroaraujo/rawrr - reddit api wrapper for R (R)
README
---
output: github_document
---```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```# rawrr
```{r, out.width="40%", echo=FALSE}
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__](https://praw.readthedocs.io/) library via the [__reticulate__](https://rstudio.github.io/reticulate/) package.
RAWRR stands for __Reddit API Wrapper for R using Reticulate__ ;)
## Installation
You can install the development version from [GitHub](https://github.com/) with:
``` r
# 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](https://www.reddit.com/wiki/search)
- `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()`