Skip to content

Instantly share code, notes, and snippets.

@AABoyles
Last active August 29, 2015 14:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AABoyles/67135ed4b8a498ba6a06 to your computer and use it in GitHub Desktop.
Save AABoyles/67135ed4b8a498ba6a06 to your computer and use it in GitHub Desktop.
Query GDELT using Google BigQuery
library(devtools)
devtools::install_github("dplyr")
library(dplyr)
devtools::install_github("bigrquery")
library(bigrquery)
billingID <- "Insert Your Project's Billing ID Here"
gdelt <- src_bigquery(billingID, "GDELT")
events <- tbl(gdelt, "events")
monthCounts <-
events %>%
group_by(MonthYear, EventCode) %>%
summarise(num = n()) %>%
arrange(MonthYear, EventCode) %>%
collect()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment