-
Notifications
You must be signed in to change notification settings - Fork 6
/
README.Rmd
59 lines (44 loc) · 1.84 KB
/
README.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
---
output: github_document
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r setup, include = FALSE}
knitr::opts_chunk$set(echo = TRUE, collapse = TRUE, comment = "#>")
```
# rreddit
[![Build status](https://travis-ci.org/mkearney/rreddit.svg?branch=master)](https://travis-ci.org/mkearney/rreddit)
[![CRAN status](https://www.r-pkg.org/badges/version/rreddit)](https://cran.r-project.org/package=rreddit)
[![Coverage Status](https://codecov.io/gh/mkearney/rreddit/branch/master/graph/badge.svg)](https://codecov.io/gh/mkearney/rreddit?branch=master)
<!--#![Downloads](https://cranlogs.r-pkg.org/badges/rreddit)
#![Downloads](https://cranlogs.r-pkg.org/badges/grand-total/rreddit)-->
[![lifecycle](https://img.shields.io/badge/lifecycle-experimental-orange.svg)](https://www.tidyverse.org/lifecycle/#experimental)
> A package for getting lots of [Reddit](https://reddit.com) data.
## Installation
Install the development version from Github with:
``` r
## install remotes pkg if not already
if (!requireNamespace("remotes")) {
install.packages("remotes")
}
## install from github
remotes::install_github("mkearney/rreddit")
```
## Use
An example of posts collected from the [r/dataisbeautiful](https://reddit.com/r/dataisbeautiful) subreddit
```{r, eval = FALSE}
## get up to 100,000 of the most recent posts made to /r/dataisbeautiful
d <- get_r_reddit("dataisbeautiful", n = 100000)
## aggregate by month and plot the time series
rtweet::ts_plot(dplyr::select(d, created_at = created_utc), "months", trim = 1) +
tfse::theme_mwk(base_size = 12) +
ggplot2::ylim(0, NA) +
ggplot2::labs(
x = NULL,
y = NULL,
title = "Activity on `r/dataisbeautiful` subreddit",
subtitle = "Monthly number of submissions on r/dataisbeautiful"
)
```
<p align="center">
<img src="tools/readme/dataisbeautiful.png" width=700 />
</p>