Mauricio "Pachá" Vargas Sepúlveda

About me | Research | Open source | Datasets | Books | R and Shiny training

About me

I am an MA student in Political Science at the University of Toronto. My research interests include International Relations, Canadian Politics and Public Policy, with a focus on the politics of trade agreements and sanctions.

I intend to explore how Generalized Linear Models, in particular the Structural Gravity Model, can be used to computationally simulate the impact of political decisions, such as a sanction being implemented. The model shows how the resulting changes in one sector in one country causes a chain reaction with consequences in GDP and other measures of economic welfare for third party countries.

I have a Master in Statistics from the Catholic University of Chile and an Engineering degree from the University of Chile. I can provide my CV (academic/profesional) upon request. You can reach me at (please remove the +spam or your messages will go to the spam folder).


Research Interests

International Relations: Trade Agreements, Sanctions, Tariff and Non-Tariff Measures.

Canadian Politics: Advocacy Coalitions, Federal Hubs, CAN-USA-MEX Transnational Policymaking.

Public Policy: Public-Private Trade Programs, Exports Diversification and Sustainability, Labour Reconversion.

Research Methods: Generalized Linear Models, Structural Gravity Model, General Equilibrium Estimation.

Published Articles

Wölwer, A.L., Burgard, J.P., Kunst, J., and Vargas Sepúlveda, M. "Gravity: Estimation Methods for Gravity Models in R." Journal of Open Source Software 3, no. 31 (November 19, 2018): 1038.


Vargas Sepúlveda, M. "Economic Effects of Chile FTAs and an Eventual CTPP Accession." arXiv, September 28, 2022.


Master in Political Science

Vargas Sepúlveda, M. "Trade Policy Analysis" University of Toronto, 2023 (Expected, title may slightly change).

Master in Statistics

Vargas Sepúlveda, M. "Gravity Modelling Into R: Strengthening Analytical Capacity of ESCAP Member States." UN ESCAP and P. U. Católica de Chile, 2021.

Open source

Selected R packages


I maintain the WebTechnologies view and the official mirror for Chile.


I created the R package varsityblues, which allows you to write assignments, presentations and thesis in RStudio by following UofT formatting. This allows the user to avoid copy-pasting tables or plots from R outputs into Word/LaTeX documents. Instead, it allows the user to work with notebooks that they can export to PDF, and it configures the LaTeX setup automatically.

This package is based on the LaTeX style files that were sent to me by the late Professor Kim C. Border.

Cloud computing

I created images for RStudio Server and RStudio Server + Kubernetes, which allows you to create virtual machines on DigitalOcean and to skip the setup time to install the Tidyverse and other packages. With these images, it takes around 30 seconds to have a ready to go setup for Data Science. This combines well with analogsea as I explained in my blog.

In simple terms, this allows you to rent a supercomputer, for example, with 48 cores and 200 GB in RAM, for a reasonable price and minimal waiting.


Open Trade Statistics

Since 2017 I've maintained Open Trade Statistics, a project created with the intention to lower the barrier to working with international economic trade data. It includes a public API, a dashboard, and an R package for data retrieval. The project started when I was affected by the fact that many Latin American Universities have limited or no access to the United Nations Commodity Trade Statistics Database (UN COMTRADE).

OTS provides a curated database derived from UN COMTRADE. I can provide a full SQL dump of the database or share subsets of the database for the period 2002-2020 aggregated by countries or by products up to a detail of six digits in the Harmonised System revision 2012.

After contacting UN COMTRADE, and suggesting to them my idea of sharing trade data but keeping commercial purposes out of the scope of the project, I got an authorization to share curated versions of their datasets.

SQL Databases for students and educators

Check SQL Databases for students and educators if you need access to PostgreSQL databases.

Publicly accessible databases often impose query limits or require registration. Even when I maintain public and limit-free APIs, I never wanted to host a public database because the connection string can be problematic for users.


Vargas Sepúlveda, M. Solutions Manual for An Advanced Guide to Trade Policy Analysis in R. 2nd ed. Bangkok: UN ESCAP, 2022.

Burchell, J. and Vargas Sepúlveda, M. The Hitchhiker's Guide to Plotnine. 1st ed. Victoria: Leanpub, 2019.

Quiroga, R. Sandoval, G., Vargas Sepúlveda, M. R para Ciencia de Datos: Soluciones de los ejercicios. 1st ed. Santiago: Self-Published, 2019.

Quiroga, R., et al. R Para Ciencia de Datos (Translation). 1st ed. Santiago: Self-Published, 2019.

Burchell, J. and Vargas Sepúlveda, M. The Hitchhiker's Guide to Ggplot2. 1st ed. Victoria: Leanpub, 2016.

R and Shiny training

I offer short courses for groups and individual personalized sessions at Buy Me a Coffee. I am a certified Tidyverse and Shiny instructor by RStudio and a Software Carpentry Instructor.

Valid HTML 4.01 Transitional