returnRegExp: Building a query element, which indicates a certain pattern...

View source: R/AggFunctions.R

returnRegExpR Documentation

Building a query element, which indicates a certain pattern of variables in a particular data table

Description

This function creates a query element to indicate a certain pattern of a variable

Usage

returnRegExp(utd_api_key = "", table_name = "", pattern = "",
  field = "")

Arguments

utd_api_key

An API key provided by a UTD server manager

table_name

A name of a data table. Input strings are NOT case-sensitive.

pattern

A pattern or a feature of a specified variable

field

A field (variable) of a data table

Value

A list of the query element of a certain pattern of a particular variable in a data table

Note

Please use this function only with the field that is not used in the other query element function. For instance; if you subset the data with a certain country, use the function, 'returnCountries()'.

Examples

## Not run: 
# to get all source actors related to governments in ICEWS
reg <- returnRegExp(utd_api_key, "icews","GOV","Source Name")
# to subset the cline_phoenix_nyt data by year == 2001
nytQuery <- returnRegExp(utd_api_key, 'cline_phoenix_nyt', '2001', 'year')
myNYTdata <- sendQuery(utd_api_key, 'cline_phoenix_nyt', nytQuery, citation = F)
## End(Not run)

KateHyoung/UTDEventData documentation built on Nov. 16, 2022, 2:29 p.m.