我目前正在尝试从国际货币基金组织的贸易统计方向下载特定系列,以计算国家之间的贸易量。有一个 r-packageimfr在这方面做得非常出色。然而,当我选择特定的一组时,我遇到了问题。
这段代码工作得很好,并为我提供了我感兴趣的五个国家的完整数据系列:
\nlibrary(imfr)\n\n# get the list of imf datasets \nimf_ids()\n\n# I am interested in direction of trade "DOT", so check the list of codes that are in the datastructure\nimf_codelist(database_id = "DOT")\n\n# I want the export and import data between countries FOB so "TXG_FOB_USD" and "TMG_FOB_USD"\nimf_codes("CL_INDICATOR_DOT")\n\n# works nicely for exports:\ndata_list_exports <- imf_data(database_id = "DOT", indicator = c("TXG_FOB_USD"), \n country = c("US","JP","KR"), \n start = "1995",\n return_raw = TRUE, \n freq = "A")\n\n# however the same code …Run Code Online (Sandbox Code Playgroud)