Learn R Programming

dataesgobr

This package intended to work with the government’s API that allow you to download, analyze and generate information through datasets obtained from the API.

Installation

You can install it using remotes package.

# install.packages("remotes")
remotes::install_github("adpl/dataesgobr")

Example

Dataesgobr package provides a web GUI able to download, load, visualize an generate information using the Government’s Spain API. You can launch it using the R console:

library(dataesgobr)
runGUI()

It is possible to use the package in the R console too, for example obtaining datasets and loading their information:

library(dataesgobr)
datasets <- search_by_title("consumo")
dataset <- load_dataset(datasets, 1)
print(dataset)

Information

Dataesgobr package is in development, so you can install, execute and test it, but it is very probable that you can find bugs while you are using it.

Copy Link

Version

Install

install.packages('dataesgobr')

Monthly Downloads

10

Version

1.0.0

License

LGPL (>= 3) | file LICENSE

Maintainer

Adrian Perez

Last Published

June 18th, 2019

Functions in dataesgobr (1.0.0)

confirm_action

Generates an interface in R console with a question and options to answer it
get_extension

Get the extension that matches with the format passed like parameter
get_available_formats

Generate a data.frame that contains the type of elements, information and repetitions for each one
get_symbol

This function detects the delim from a csv file
download_data

Download files asociate with dataesgobr object
get_publishers_from_api

This method send a request to datos.gob.es and return a data.frame that contains the publishers in the catalog
get_spatials_from_api

This method send a request to datos.gob.es and return a data.frame that contains the spatials available in the catalog
filter_by

Filter data.frame using params passed
get_themes_from_api

This method send a request to datos.gob.es and return a data.frame that contains the themes available in the catalog
load_data

Load data from a file
get_publisher

Get the publisher of the dataset
check_csv_file

Check if the csv file has a correct format
check_file

Check if the dataset has a correct format
load_dataset

Load dataset from a data.frame
search_by_theme

Creates a data.frame containing datasets from datos.gob.es
graphic_data

Draw a plot using the pararameters passed
graphic_keywords

Represent keywords in a plot
datos

Format data on dataesgobr
search_by_title

Creates a data.frame containing datasets from datos.gob.es
get_formats

Generate a list that contains the type of elements and repetitions for each one
make_url

Loads the file url_params and make urls to extract information from the API
get_format

Get the format that matches with the extension passed like parameter
runGUI

Launches the web-based GUI for dataesgobr
search_by_publisher

Creates a data.frame containing datasets from datos.gob.es
search_by_spatial

Creates a data.frame containing datasets from datos.gob.es
filter_by_keywords

Filter data.frame by keywords using keywords param
get_all_keywords

Obtain keywords in data.frame with the number of ocurrences
filter_by_description

Filter data.frame by description using q param
filter_by_title

Filter data.frame by title using q param
get_id

This method extracts the ID from an URL
search_by

Creates a data.frame containing datasets from datos.gob.es that matches the parameters passed
search_by_id

Creates an object of the class dataesgobr that matches with the dataset id
get_name

Extract the name of the file in the URL
get_provinces_from_api

This method send a request to datos.gob.es and return a data.frame that contains the provinces in the catalog