ColombiAPI 0.3.2
CRAN Policy Compliance — Graceful Failure for Internet Resources
This release fixes all functions that use internet resources to comply with the CRAN policy: “Packages which use Internet resources should fail gracefully with an informative message if the resource is not available or has changed.”
Functions fixed — API Colombia
get_colombia_airports(): AddedtryCatch(),httr::timeout(10),is.null()guard,httr::status_code(), andtryCatch()onhttr::content()andjsonlite::fromJSON(). Correctedis.null()check order beforelength().get_colombia_attractions(): Addedhttr::timeout(10)andtryCatch()onhttr::content(). Renamed internal variableresponsetoresfor consistency.get_colombia_cities(): Addedhttr::timeout(10)andtryCatch()onhttr::content(). Renamed internal variableresponsetoresfor consistency.get_colombia_departments(): AddedtryCatch(),httr::timeout(10),is.null()guard,httr::status_code(), andtryCatch()onhttr::content()andjsonlite::fromJSON(). Correctedis.null()check order beforelength().get_colombia_invasive_species(): Addedhttr::timeout(10)andtryCatch()onhttr::content(). Renamed internal variableresponsetoresfor consistency.get_colombia_native_communities(): Addedhttr::timeout(10)andtryCatch()onhttr::content(). Renamed internal variableresponsetoresfor consistency.get_colombia_natural_areas(): Addedhttr::timeout(10)andtryCatch()onhttr::content(). Renamed internal variableresponsetoresfor consistency.get_colombia_presidents(): AddedtryCatch(),httr::timeout(10),is.null()guard,httr::status_code(), andtryCatch()onhttr::content()andjsonlite::fromJSON(). Correctedis.null()check order beforelength().get_colombia_radios(): Addedhttr::timeout(10)andtryCatch()onhttr::content(). Renamed internal variableresponsetoresfor consistency.get_colombia_regions(): AddedtryCatch(),httr::timeout(10),is.null()guard,httr::status_code(), andtryCatch()onhttr::content()andjsonlite::fromJSON(). Correctedis.null()check order beforelength().get_colombia_typical_dishes(): Addedhttr::timeout(10)andtryCatch()onhttr::content(). Renamed internal variableresponsetoresfor consistency.
Functions fixed — World Bank API
get_colombia_child_mortality(): AddedtryCatch(),httr::timeout(10),is.null()guard,httr::status_code(), andtryCatch()onhttr::content()andjsonlite::fromJSON(). Correctedis.null()check order beforelength(). Removed unnecessaryreturn(df).get_colombia_cpi(): AddedtryCatch(),httr::timeout(10),is.null()guard,httr::status_code(), andtryCatch()onhttr::content()andjsonlite::fromJSON(). Correctedis.null()check order beforelength(). Removed unnecessaryreturn(df).get_colombia_energy_use(): AddedtryCatch(),httr::timeout(10),is.null()guard,httr::status_code(), andtryCatch()onhttr::content()andjsonlite::fromJSON(). Correctedis.null()check order beforelength(). Removed unnecessaryreturn(df).get_colombia_gdp(): Addedtimeoutandstatus_codeto@importFrom httrdirective. All other graceful failure handling was already correctly implemented.get_colombia_hospital_beds(): AddedtryCatch(),httr::timeout(10),is.null()guard,httr::status_code(), andtryCatch()onhttr::content()andjsonlite::fromJSON(). Correctedis.null()check order beforelength(). Removed unnecessaryreturn(df).get_colombia_life_expectancy(): Removed incorrectempty_dffallback pattern andUser-Agentheader. Standardized to returnNULLwith an informative message on failure. Removedif (interactive())guards onmessage()calls. AddedtryCatch()onhttr::content()as a separate guard. Replaced\donttest{}withif (interactive())in examples.get_colombia_literacy_rate(): AddedtryCatch(),httr::timeout(10),is.null()guard,httr::status_code(), andtryCatch()onhttr::content()andjsonlite::fromJSON(). Correctedis.null()check order beforelength(). Replaced\donttest{}withif (interactive())in examples. Removed unnecessaryreturn(df).get_colombia_population(): AddedtryCatch(),httr::timeout(10),is.null()guard,httr::status_code(), andtryCatch()onhttr::content()andjsonlite::fromJSON(). Correctedis.null()check order beforelength(). Removed unnecessaryreturn(df).get_colombia_unemployment(): AddedtryCatch(),httr::timeout(10),is.null()guard,httr::status_code(), andtryCatch()onhttr::content()andjsonlite::fromJSON(). Correctedis.null()check order beforelength(). Removed unnecessaryreturn(df).
Functions fixed — Nager.Date API
-
get_colombia_holidays(): Added@details,@note, and@seealsoroxygen tags for consistency with the rest of the package. Removed internal comments for cleaner code. All graceful failure handling was already correctly implemented.
Functions fixed — REST Countries API
-
get_country_info_co(): Addedhttr::timeout(10),tryCatch()onhttr::content(),nchar(txt) == 0validation for empty responses, and defensive field extraction withNA_character_/NA_real_fallbacks for all fields. Removed Spanish-language error messages for consistency. Renamed internal variableresponsetores. Replaced\donttest{}withif (interactive())in examples. Expanded@return,@description,@details, and@noteroxygen tags for consistency.
Additional improvements across all fixed functions
- Replaced
res$status_codewithhttr::status_code(res)(correct httr idiom). - Corrected
is.null()check order — always evaluated beforelength()to prevent errors when object is NULL. - Replaced
\donttest{}withif (interactive())in all examples for consistency. - Removed unnecessary
return(df)at end of functions (idiomatic R style). - Updated
@importFrom httrdirectives to includetimeoutandstatus_codewhere missing. - Updated copyright year from 2025 to 2025-2026.
ColombiAPI 0.3.1
CRAN release: 2025-10-12
Bug Fixes
Test Corrections for CRAN Compliance
Fixed
get_colombia_literacy_rate()tests: Corrected data type expectations for thevaluecolumn fromintegertonumeric. The World Bank API returns literacy rates as decimal percentages (e.g., 95.68%), which are naturally of typenumeric/double, notinteger.-
Fixed
get_colombia_life_expectancy()tests:- Added
skip_on_cran()to all tests to properly handle offline environments during CRAN checks - Improved error handling by adding
User-Agentheaders to HTTP requests - Added explicit
NULLchecks before structure validation to prevent test failures - Enhanced robustness of API error handling with better
tryCatch()implementation
- Added
ColombiAPI 0.3.0
CRAN release: 2025-09-29
Breaking Changes
This release significantly expands the scope of ColombiAPI with 12 new curated datasets.
These additions cover diverse domains such as indigenous languages, education, biodiversity, digital transformation, mobility, tourism, connectivity, and economic projections.
Newly Added Datasets
-
indigenous_vocabulary_df: Comparative Vocabulary for Colombia’s Indigenous Languages -
admitted_students_df: Admitted Students to the Science Faculty, UNAL (2013-I) -
school_levels_df: Departments by Levels of Schools in Colombia -
dead_lianas_df: Mortality of lianas (vines) in tropical forests -
municipalities_tbl_df: Municipalities of Colombia -
Bucaramanga_wifi_tbl_df: WiFi Connectivity Zones in Bucaramanga -
Cartagena_wifi_tbl_df: Connected Devices in WiFi Zones of Cartagena -
digital_graduates_tbl_df: “Advancing in Digital” Program Graduates -
vehicle_count_tbl_df: Vehicle Count: Cars and Motorcycles -
foreign_visitors_tbl_df: Non-Resident Foreign Visitors to Colombia -
digital_centers_tbl_df: Digital Centers in Sucre -
gdp_departments_tbl_df: Departmental GDP Projection
ColombiAPI 0.2.0
CRAN release: 2025-09-17
Breaking Changes
view_datasets()was renamed toview_datasets_ColombiAPI()to avoid naming conflicts with other packages and improve function identification.get_airports_list()was renamed toget_colombia_airports()to avoid naming conflicts with other packages and improve function identification.get_Colombia_info()was renamed toget_country_info_co()to avoid naming conflicts with other packages and improve function identification.get_country_info_co()Not only was the function name changed, but its data source also shifted fromAPI-Colombiato theREST CountriesAPI.get_departments_list()was renamed toget_colombia_departments()to avoid naming conflicts with other packages and improve function identification.get_presidents_list()was renamed toget_colombia_presidents()to avoid naming conflicts with other packages and improve function identification.get_regions_list()was renamed toget_colombia_regions()to avoid naming conflicts with other packages and improve function identification.
New APIs added
- Nager.Date https://date.nager.at/Api
- World Bank API https://datahelpdesk.worldbank.org/knowledgebase/articles/889392
- REST Countries API https://restcountries.com/
ColombiAPI 0.1.1
CRAN release: 2025-02-16
Fixed function
- Fix
get_airports_list()latitud and longitud error, now that function is namedget_colombia_airports()
