get_subsector_info {NSO1212} | R Documentation |
Detailed Information about a Sub-Sector
Description
Detailed information about a sub-sector, which is minor classification of data, on the open-data API which is supported by National Statistical Office of Mongolia
Usage
get_subsector_info(subid, try = FALSE, timeout = Inf)
Arguments
subid |
character string, Sub-sector identification number |
try |
logical: Should the body of the function be wrapped by the function |
timeout |
positive numeric or |
Details
The NSO server returns "HTTP error 500" frequently. Due to the server error, error handling is supported. if try
is TRUE
, you have to write code with error handling as shown in the example.
Value
A data frame which has sub-sector information if the function is executed without error, but an object of class "try-error" containing the error message, if it fails. The data frame has following structure:
- rownum
Row number
- list_id
Sector identification number
- up_list_id
Sub sector identification number
- list_nm
Sector name in Mongolian
- list_eng_nm
Sector name in English
- isExist
Whether or exist sub-sectors
References
http://opendata.1212.mn/en/doc/Api/GET-api-Sector_subid
See Also
all_tables, get_table, get_table_info, get_sector_info
Examples
subsector_info <- get_subsector_info("976_L05", try = TRUE, timeout = 4)
if (!inherits(subsector_info, "try-error")) {
print(subsector_info)
}