-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathData_Pull.Rmd
39 lines (27 loc) · 980 Bytes
/
Data_Pull.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
---
title: "Data_Pull"
date: "2022-09-30"
output: html_document
---
## Summary
This script allows the user to interact with the UTDEventData R package and query event data. More information can be found at https://github.com/KateHyoung/UTDEventData.
## Install Packages and Load Libraries
```{r}
install.packages("devtools")
library(devtools)
library(remotes)
install_github("KateHyoung/UTDEventData")
library(UTDEventData)
```
## Define your API key by placing it between the below quotes
```{r}
utd_api_key <- ""
```
## Query event data
```{r}
table_name <- "phoenix_rt"
country <- list('USA', 'DEU', 'GBR', 'RUS', 'UKR', 'CHN', 'IND', 'TUR') #If one country is desired, use list("USA") or list("DEU"), etc.
start <- "20180101" #Make sure there is a "0" in front of the single-digit months
end <- "20180430" #Make sure there is a "0" in front of the single-digit months
EventData <- pullData(utd_api_key, table_name, country, start, end, citation = FALSE)
```