knitr::opts_chunk$set(
    collapse = TRUE,
    comment = '#>',
    fig.path = 'man/figures/README-',
    out.width = '100%'
)

amloconf

License: MIT ![](https://img.shields.io/badge/last change-r Sys.setlocale('LC_TIME','English'); format(Sys.time(), '%B %d, %Y')-yellowgreen.svg) Lifecycle: experimental

The purpose of amloconf is to provide a tool to retrieve the stenographic versions of the conferences given by the Mexican President, Andrés Manuel López Obrador, in handy-dialog-formatted lists.

This tool could help carry out text mining and sentiment analysis on the Mexican President's press conferences. This package aims to ease the access to such press conferences to anyone willing to analyze them using the R framework. Hence, this package's purpose is entirely objective. Any claim, result, or work based on the information retrieved through this package is the complete responsibility of the author of such work and not the author of this package.

Installation

You can install the development version from GitHub with:

``` {r install}

install.packages('devtools')

devtools::install_github('alejandroxag/amloconf')

library(amloconf)

If it asks for updates of other packages, the better thing to do is to choose
the 'None' option (pressing number 3 on the keyboard).

## Usage

The ``amloconf`` package includes three functions: ``urls_parsing``, ``find_urls``, and ``text_extraction``.

### ``urls_parsing``

``urls_parsing(page)`` passes ``page`` as an argument to the function
``glue::glue('https://presidente.gob.mx/secciones/version-estenografica/page/{page}/')``,
and parses all URLs pointing to a conference, within that specific page's URL.
It mainly serves as an auxiliary function to ``find_urls``, but could be useful
to retrieve URLs subsets with unclear start or end dates, so the argument
``page`` can be used instead.

```r
n <- 5
urls <- urls_parsing(page = n)
urls

find_urls

find_urls(dates) returns all the URLs pointing to conferences hosted on the specified dates. It mainly serves as an auxiliary function to the text_extraction function. However, it can be useful if the URLs associated with a specific date or group of dates want to be consulted directly in the browser. Since the main website hosting the press conferences has many pages, it's faster to get the URLs using this function than clicking the next/previous buttons at the bottom of the website.

dates <- seq(lubridate::ymd('2020-10-01'),
             lubridate::ymd('2020-10-16'),
             by = 'day')
urls <- find_urls(dates = dates)
urls

text_extraction

text_extraction retrieves the text corresponding to the conferences specified in the arguments, in a dialog-formatted list. See text_extraction for further details. This function is the main of this package, since it can be used to retrieve the conferences in ready-to-use format.

conferences <- text_extraction(dates = '2020-10-16')
conferences[1:10]


alejandroxag/amloconf documentation built on Dec. 31, 2020, 7:41 p.m.