Package 'CBRT'

Title: CBRT Data on Turkish Economy
Description: The Central Bank of the Republic of Turkey (CBRT) provides one of the most comprehensive time series databases on the Turkish economy. The 'CBRT' package provides functions for accessing the CBRT's electronic data delivery system <https://evds2.tcmb.gov.tr/>. It contains the lists of all data categories and data groups for searching the available variables (data series). As of November 3, 2024, there were 40,826 variables in the dataset. The lists of data categories and data groups can be updated by the user at any time. A specific variable, a group of variables, or all variables in a data group can be downloaded at different frequencies using a variety of aggregation methods.
Authors: Erol Taymaz [aut, cre]
Maintainer: Erol Taymaz <[email protected]>
License: GPL-3
Version: 0.1.1
Built: 2024-11-14 06:57:05 UTC
Source: CRAN

Help Index


Data categories

Description

A dataset containing the list of all data categories in the CBRT dataset

Usage

allCBRTCategories

Format

A data table with 23 rows and 2 variables:

cid

Category ID

topic

Topic


Data groups

Description

A dataset containing the list of all data groups in the CBRT dataset

Usage

allCBRTGroups

Format

A data table with 323 rows and 10 variables:

cid

Category ID

groupCode

Data group code (used for downloading the data)

groupName

Name of the data group

freq

Time series frequency code

source

Data source

sourceLink

URL of the data source

revisionPolicy

Revision policy for the data group

firstDate

The beginning date for the data

lastDate

The end date for the data

appLing

URL


Data series

Description

A dataset containing the list of all data series in the CBRT dataset

Usage

allCBRTSeries

Format

A data table frame with 22,243 rows and 12 variables:

cid

Category ID

topic

Topic

groupCode

Data group code

groupName

Name of the data group

freq

Time series frequency code

seriesCode

Data series code (used for downloading the data)

seriesName

Name of the data series

start

Starting date, DD-MM-YYYY

end

Ending date, DD-MM-YYYY

aggMethod

Data aggregation method

freqname

Time series frequency

tag

Tages (keywords)


Aggregation methods

Description

A dataset containing the list of aggregation methods

Usage

CBRTagg

Format

A data table frame with 6 rows and 2 variables:

Code

Aggregation code

Aggregation

Aggregation method


Frequenciess

Description

A dataset containing the list of frequencies

Usage

CBRTfreq

Format

A data table frame with 8 rows and 4 variables:

freq

Frequency code

tfreq

Frequency code (internal use)

FreqEng

Frequency name (English)

FreqTr

Frequency name (Turkish)


Information about data categories

Description

Creates a meta data object for all categories

Usage

getAllCategoriesInfo(CBRTKey = myCBRTKey)

Arguments

CBRTKey

Your personal CBRT access key

Value

a data.table object

Examples

## Not run: 
allCBRTCategories <- getAllCategoriesInfo()

## End(Not run)

Information about data groups

Description

Creates a meta data object for all data gorups

Usage

getAllGroupsInfo(CBRTKey = myCBRTKey)

Arguments

CBRTKey

Your personal CBRT access key

Value

a data.table object

Examples

## Not run: 
allCBRTGroups <- getAllGroupsInfo()

## End(Not run)

Information about data series

Description

Creates a meta data object for all data series

Usage

getAllSeriesInfo(CBRTKey = myCBRTKey, verbose = TRUE)

Arguments

CBRTKey

Your personal CBRT access key

verbose

TRUE turns on status and information messages to the console

Value

a data.table object

Examples

## Not run: 
allCBRTSeries <- getAllSeriesInfo()

## End(Not run)

Downloading data groups

Description

Downloads all data series of a data group

Usage

getDataGroup(
  group,
  CBRTKey = myCBRTKey,
  freq,
  startDate = "01-01-1950",
  endDate,
  na.rm = TRUE,
  verbose = TRUE
)

Arguments

group

Code for the data group.

CBRTKey

Your personal CBRT access key.

freq

Numeric, the frequency of the data series. If not defined, the default (the highest possible frequency) will be used. The frequencies are as follows:

1

Day

2

Work day

3

Week

4

Biweekly

5

Month

6

Quarter

7

Six months

8

Year

If a frequency level lower than the default is used, the data will be aggregated by using the default method for that data group (for example, if monthly data are download for weekly series).

startDate

The beginning date for data series (DD-MM-YYYY).

endDate

The ending date for data series (DD-MM-YYYY). If not defined, the default (the latest available) will be used.

na.rm

Logical variable to drop all missing dates.

verbose

TRUE turns on status and information messages to the console.

Value

a data.table object

Examples

## Not run: 
myData <- getDataGroup("bie_dbafod")

## End(Not run)

Downloading data series

Description

Downloads one or more data series from the CBRT datasets.

Usage

getDataSeries(
  series,
  CBRTKey = myCBRTKey,
  freq,
  aggType,
  startDate = "01-01-1950",
  endDate,
  na.rm = TRUE
)

Arguments

series

A vector of data series' codes.

CBRTKey

Your personal CBRT access key.

freq

Numeric, the frequency of the data series. If not defined, the default (the highest possible frequency) will be used. The frequencies are as follows:

1

Day

2

Work day

3

Week

4

Biweekly

5

Month

6

Quarter

7

Six months

8

Year

aggType

Aggregation of data series. This paremeter defines the method to be used to aggregate data series from high frequency to low frequency (for example, weekly data to monthly data). The following methods are available:

avg

Average value

first

First observation

last

Last observation

max

Maximum value

min

Minimum value

sum

Sum

If a frequency level lower than the default is used, the data will be aggregated by using the default method for that data group (for example, if monthly data are download for weekly series).

startDate

The beginning date for data series (DD-MM-YYYY).

endDate

The ending date for data series (DD-MM-YYYY). If not defined, the default (the latest available) will be used.

na.rm

Logical variable to drop all missing dates.

Value

a data.table object

Examples

## Not run: 
mySeries <- getDataSeries("TP.D1TOP")
mySeries <- getDataSeries(c("TP.D1TOP", "TP.D2HAZ", "TP.D4TCMB"))
mySeries <- getDataSeries(c("TP.D1TOP", "TP.D2HAZ", "TP.D4TCMB", startDate="01-01-2010"))

## End(Not run)

Variable search

Description

Search for keywords in the CBRT datasets

Usage

searchCBRT(keywords, field = c("groups", "categories", "series"), tags = FALSE)

Arguments

keywords

A vector of keywords

field

The name of the field to be searched ("groups", "categories" or "series"). We recommend searching first the "groups" names.

tags

A logical variable that indicates if the tags to be searched

Value

a data.table object

Examples

searchCBRT(c("production", "labor", "labour"))
searchCBRT(c("production", "labor", "labour"), field = "series")
searchCBRT(c("production", "labor", "labour"), tags = TRUE)

Information about a data group

Description

Shows information about a data group

Usage

showGroupInfo(gCode, verbose = TRUE)

Arguments

gCode

the code for the data group

verbose

TRUE turns on status and information messages to the console

Value

a data.table object

Examples

showGroupInfo("bie_apifon")

Showing variable names

Description

Shows the names of all variables in a data group

Usage

showSeriesNames(gCode)

Arguments

gCode

the code for the data group

Value

a data.table object

Examples

showSeriesNames("bie_apifon")