Code Monkey home page Code Monkey logo

amloconf's Introduction

amloconf

License: MIT 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:

# 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.

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]

amloconf's People

Contributors

alejandroxag avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.