View source: R/SearchFunctions.R
tableVar | R Documentation |
Searching the list of variables in the data table a user specifies.
It returns variable names and requires an API key.
You can also look up a particular word of variabla names such as "day", "month", or "src" so that you can find whether or not a
specified data table has the certain variables you need.
The API key can be obtained after submitting 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()
.
The option of storing an API key in an environment variable is prepared to run the function without passing an API key every time. Please see the examples bellow.
tableVar(table = "", utd_api_key = NULL, lword = "")
table |
a specific data table a user wants to explore its variables |
utd_api_key |
an API key from the developer at UTD |
lword |
a look-up word for a particular variable name you need |
A list of variable names of the specified data table
## Not run: # when searching the variables in Phoenix_RT tableVar(table="phoenix_rt", utd_api_key="...") # when searhing the variable which includes the word of "tar" in ICEWS tableVar(table="icews", lword="tar", utd_api_key="...") # method 1: passing a key as the first argument k <- "utd_api_key" tableVar(table="phoenix_rt", utd_api_key = k) tableVar(table="icews", utd_api_key = k, lword="target") # Method 2: storing the key in an environment variable Sys.setenv(UTDAPIKEY = "...your API key...") tableVar(table = "icews", lword = "target") ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.