ColombiAPI: Exploring Colombia's Public Data with API-Colombia
Source:vignettes/colombiAPI_vignette.Rmd
colombiAPI_vignette.Rmd
library(ColombiAPI)
#> Error in get(paste0(generic, ".", class), envir = get_method_env()) :
#> object 'type_sum.accel' not found
library(dplyr)
#>
#> Attaching package: 'dplyr'
#> The following objects are masked from 'package:stats':
#>
#> filter, lag
#> The following objects are masked from 'package:base':
#>
#> intersect, setdiff, setequal, union
Introduction
The ColombiAPI
package provides a seamless interface to
access diverse public data about Colombia
through the
API-Colombia
, a RESTful API. The package enables users to
explore various aspects of Colombia
, including general
information, geography, and cultural insights. It includes five
API-related functions to retrieve data on topics such as
Colombia
’s general information, airports, departments,
regions, and presidents.
Additionally, ColombiAPI
offers a built-in function to
view the datasets available within the package. The package also
includes curated datasets covering Bogota air stations, business and
holiday dates, public schools, Colombian coffee exports, cannabis
licenses, Medellin rainfall, and malls in Bogota, making it a
comprehensive tool for exploring Colombia
’s data.
Functions for API-Colombia
The ColombiAPI
package provides five primary functions
to retrieve data from the API-Colombia
, we’ll show you how
two of them work in this section:
-
get_Colombia_info()
Retrieves general information aboutColombia
, including its capital, surface area, population, and languages.
get_Colombia_info()
#> name surface population timeZone currency currencySymbol region
#> 1 Colombia 1141748 52235050 UTC-5 Colombian Peso $ Americas
-
get_regions_list()
Retrieves information aboutColombia
’s regions, showcasing their unique characteristics.
get_regions_list()
#> id name
#> 1 4 Amazonía
#> 2 5 Andina
#> 3 1 Caribe
#> 4 6 Insular
#> 5 3 Orinoquía
#> 6 2 Pacífico
get_departments_list()
: Lists all the departments ofColombia
, including their geographical information.get_presidents_list()
: Provides a list of all presidents inColombia
’s history.get_airports_list()
: Get the List of Airports inColombia
.
Datasets Included in ColombiAPI
In addition to API functions, ColombiAPI
includes
several preloaded datasets that provide valuable insights into various
aspects of Colombia
:
Bogota_airstations_df
: A data frame containing coordinates of air quality monitoring stations in Bogota.Bogota_business_Date
: A Date object listing official business dates in Bogota.Bogota_holidays_Date
: A Date object listing official holidays in Bogota.Bogota_malls_tbl_df
: A tibble with detailed information about malls in Bogota.Cannabis_Licenses_tbl_df
: A tibble containing data on cannabis licenses issued in Colombia.Colombia_coffee_tbl_df
: A tibble with details of Colombian coffee export and import for the year 2016.Medellin_rain_tbl_df
: A tibble providing rainfall data for Medellin.Tulua_Public_Schools_tbl_df
: A tibble with information on public schools in Tulua.
Viewing All Available Datasets
The ColombiAPI
package includes a built-in function,
view_datasets()
, which allows users to view a comprehensive
list of all datasets available in the package directly from the
console:
view_datasets()
#> Datasets available in the ColombiAPI package:
#> [1] "Bogota_airstations_df" "Bogota_business_Date"
#> [3] "Bogota_holidays_Date" "Bogota_malls_tbl_df"
#> [5] "Cannabis_Licenses_tbl_df" "Colombia_coffee_tbl_df"
#> [7] "Medellin_rain_tbl_df" "Tulua_Public_Schools_tbl_df"
Conclusion
The ColombiAPI
package offers a powerful set of tools
for accessing and analyzing public data about Colombia. From exploring
general information about the country to diving into specific datasets
on topics like air quality, public schools, or coffee exports,
ColombiAPI
enables users to engage with Colombia’s rich
data landscape easily. For more detailed examples and use cases, refer
to the full package documentation or explore the datasets using the
built-in functions.