Type: | Package |
Title: | CBRT Data on Turkish Economy |
Version: | 0.1.1 |
Maintainer: | Erol Taymaz <etaymaz@metu.edu.tr> |
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. |
License: | GPL-3 |
URL: | https://github.com/etaymaz/CBRT |
Encoding: | UTF-8 |
LazyData: | true |
Depends: | R (≥ 3.5.0), data.table, curl |
Suggests: | knitr, rmarkdown |
VignetteBuilder: | knitr |
RoxygenNote: | 7.3.2 |
NeedsCompilation: | no |
Packaged: | 2024-11-12 19:47:30 UTC; etaymaz |
Author: | Erol Taymaz |
Repository: | CRAN |
Date/Publication: | 2024-11-13 15:10:10 UTC |
CBT API function
Description
Reading the data from the CBT server
Usage
CBRT_fread(fileName, CBRTKey)
Arguments
fileName |
URL for API |
CBRTKey |
Individual key for CB API |
Value
The data from CBRT
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)
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)
Changing characters to ASCII
Description
Changes non-ASCII characters to ASCII
Usage
changeASCII(x)
Arguments
x |
String to be modifies |
Value
Modified string
Formatting time series
Description
Sets the format of a time series object retrieved from the CBRT database
Usage
formatTime(x)
Arguments
x |
a data series |
Value
formatted object
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:
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:
|
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:
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")