Learn R Programming

IMFData (version 0.2.0)

CodeSearch: Search Available Code in a Dimension of a Given Dataset

Description

CodeSearch search matching codes in a given dimension of a dataset

Usage

CodeSearch(available.codes, code, searchtext, search.value = TRUE, search.text = TRUE)

Arguments

available.codes
string. Database ID of the dataset.
code
string. Dimension code get from DataStructureMethod.
searchtext
string. String to search in the dimension code.
search.value
logical. If true, it will search searchtext in CodeValue.
search.text
logical. If true, it will search searchtext in CodeText.

Value

A list for each dimension. The name of the list is the dimension name. Each element of the list is a data frame with two columns; dimension code and dimension text(description).

Examples

Run this code

IFS.available.codes <- DataStructureMethod('IFS') # Get dimension code of IFS dataset
names(IFS.available.codes) # Available dimension code
IFS.available.codes[[1]] # Possible code in the first dimension
CodeSearch(IFS.available.codes, 'CLL', 'GDP') # Error (CLL is not a dimension code of IFS dataset)
CodeSearch(IFS.available.codes, 'CL_INDICATOR_IFS', 'GDP') # Search code contains GDP
CodeSearch(IFS.available.codes, 'CL_INDICATOR_IFS', 'GDPABCDE') # NULL


Run the code above in your browser using DataLab