An open API service indexing awesome lists of open source software.

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

Awesome Lists containing this project

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()`