The goal of this manual is to provide the basic foundations needed to analyze and visualize Open Contracting data using the R programming language to people that might be interested in pursuing this challenging but worthy endeavor. A basic understanding of computer programming will come in handy when reading this document; however, enough guidance is provided to ensure that less-tech-savvy readers can also follow along.
As a part of this guide, we fetch, clean, analyze and plot samples of Open Contracting data from 4 members of the partnership: Paraguay, Mexico, Uruguay and Colombia. This document was written using R Notebooks, a nifty feature which allows convenient integration of Markdown and R code, and exporting to HTML and PDF. The source code of this project is available here.
The rest of this document is organized as follows:
The remainder of this section introduces the Open Contracting Data Standard, briefly describing its main building blocks, and the R programming language, covering its core features and how to install it.
Section 2 deals with data acquisition and cleaning, focusing on reading and processing JSON with R.
Section 3 presents the Tidyverse, a collection of R packages designed to perform common data science tasks.
Finally, section 4 introduces ggplot2 and the grammar of graphics it is based on, to draw several plots that describe our previously acquired datasets.
By requiring data-sharing in a structured, re-usable and machine readable form, Open data opens up new opportunities for analysis and citizen engagement and participation. The Open Contracting Data Standard was created to apply these principles to the complete contracting lifecycle including planning, tender, award, contract and implementation.
The data standard, designed and developed through an open process, allows governments and cities around the world to share their contracting data, enabling greater transparency in public contracting, and supporting accessible and in-depth analysis of the efficiency, effectiveness, fairness, and integrity of public contracting systems. Additionally, the help desk team, staffed by Open Data Services Co-operative, is available to assist prospective users in their journey towards adoption of the standard.
The intention of this section is to introduce the reader to the standard, the use cases it was designed for and the basic concepts needed to apply it. Most of the content was taken from the official documentation of the standard; for a more thorough introductory walktrough, please refer to the getting started guide.
The standard was designed with four main groups of user needs:
To find out about who is using OCDS-compliant data around the globe and how they are doing it, have a look at the Open Contracting Partnership website. Four potential use cases for open contracting data are:
The standard defines a contracting process as:
All the planning, tendering information, awards, contracts and contract implementation information related to a single initiation process.
The standard covers all the stages of a contracting process, even though some processes might not involve all possible steps. The stages of the procurement process, with example objects that might be associated to each one, are depicted in figure 1.