forked from jtleek/papr
-
Notifications
You must be signed in to change notification settings - Fork 1
/
report.Rmd
53 lines (43 loc) · 1.08 KB
/
report.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
---
title: "papr user report"
output:
flexdashboard::flex_dashboard:
orientation: columns
vertical_layout: fill
runtime: shiny
---
```{r setup, include=FALSE}
library(flexdashboard)
library(rdrop2)
library(readr)
library(dplyr)
token <- readRDS("./papr-drop.rds")
```
```{r, message = FALSE, warning = FALSE, results = "hide"}
#read in data
files <- drop_dir("shiny/2016/papr/user_dat/", dtoken = token)$path
tbl <- lapply(files, drop_read_csv, dtoken = token) %>%
bind_rows()
tbl_twitter <- tbl %>%
filter(!is.na(twitter)) %>%
mutate(twitter = gsub("https://twitter.com/","",twitter)) ## some people seem to do this :(
file_path <- file.path(tempdir(), "twitter.csv")
write_csv(tbl_twitter, file_path)
drop_upload(file_path, "shiny/2016/papr/comb_dat", dtoken = token)
```
Row
-----------------------------------------------------------------------
### Total users logged in {.value-box}
```{r}
valueBox(
value = nrow(tbl),
icon = "fa-sign-in"
)
```
### Total users input twitter handle {.value-box}
```{r}
valueBox(
value = nrow(tbl_twitter),
icon = "fa-twitter"
)
```