Last active
August 29, 2015 14:05
-
-
Save AABoyles/67135ed4b8a498ba6a06 to your computer and use it in GitHub Desktop.
Query GDELT using Google BigQuery
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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