pullData | R Documentation |
This is the main function to extract subdata from the UTD Event data server by country names and time ranges.
The API key is required and can be obtained after filling out the form in the UTD event data sign-up website (http://eventdata.utdallas.edu/signup).
Please follow the direction in the UTD sign-up webpage.
You can also use this function through the reference class, Table()
.
Please find the help document of the Table()
function for more details for its usage.
pullData(utd_api_key = NULL, table_name = " ", country = list(), start = " ", end = " ", citation = TRUE)
utd_api_key |
An API key provided by the server manager at UTD. |
table_name |
The name of data table you want to have. You may find available data tables from DataTables( ) |
country |
List of countries. We recommend to use the ISO ALPHA-3 Code format, but
the full country name is also working in this function. |
start |
The "YYYYMMDD" format of the first date of a data set |
end |
The "YYYYMMDD" format of the end date of a data set |
citation |
logical; If |
A list with components
$data
a data frame of requested data. An attribute of the data can be formatted as data.frame. Please check the features of data if it's necessary
$citation
a text of the package citation
## Not run: pullData(utd_api_key=" ", table_name="Phoenix_rt", country=list("USA","MEX","SYR","CHN"), start="20171101", end="20171112", citation = TRUE) ## Another way to avoid repeating an API key into the function k <- '...api key...' subset1 <- pullData(k, "phoenix_rt", list('canada','China'), '20171101', '20171102') subset2 <- pullData(k, "icews", list('can', 'usa'), '20010101','20010110') subset3 <- pullData(k, 'cline_Phoenix_NYT',list('South Korea','canada'), '19551105','19581215') ## Data retreval without the citation pullData(k, "phoenix_rt", list("USA"), "20171115", "20171120", citation = FALSE) ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.