issues: Issue data for the dplyr repo from github API

Description Usage Format Examples

Description

Issue data for the dplyr repo from github API

Usage

1

Format

JSON

Examples

 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
library(dplyr)

# Show first 200 characters of JSON
issues %>% substr(1, 200) %>% writeLines

# Extract metadata for every issue
issues %>%          # single json document of github issues from dplyr
  gather_array %>%  # stack as an array
  spread_values(
    id          = jnumber("id"),
    number      = jnumber("number"),
    title       = jstring("title"),
    user.login  = jstring("user", "login"),
    sate        = jstring("state"),
    locked      = jlogical("locked"),
    comments    = jnumber("comments")
  ) %>% head

# Extract label content for issues with labels
issues %>%          # single json document of github issues from dplyr
  gather_array %>%  # stack as an array
  spread_values(id = jnumber("id")) %>% # capture issue id for relational purposes
  enter_object("labels") %>%            # filter just those with labels
  gather_array("label.index") %>%       # stack labels
  spread_values(
    url   = jstring("url"),
    name  = jstring("name"),
    color = jstring("color")
  ) %>% head

# Get all URLs at the top level of the JSON
issues %>%
  gather_array %>%
  gather_keys %>%
  append_values_string() %>%
  filter(grepl("url", key)) %>%
  head

sailthru/tidyjson documentation built on May 29, 2019, 12:59 p.m.