Appendix C. R and DHIS 2 Integration

Table of Contents

C.1. Introduction
C.2. Using ODBC to retrieve data from DHIS2 into R
C.3. Using R with MyDatamart
C.4. Mapping with R and Postgresql
C.5. Using R, DHIS2 and the Google Visualization API
C.6. Using PL/R with DHIS2
C.7. Using this DHIS2 Web API with R

C.1. Introduction

R is freely available, open source statistical computing environment. R refers to both the computer programming language, as well as the software which can be used to create and run R scripts. There are numerous sources on the web which describe the extensive set of features of R.

R is a natural extension to DHIS2, as it provides powerful statistical routines, data manipulation functions, and visualization tools. This chapter will describe how to setup R and DHIS2 on the same server, and will provide a simple example of how to retrieve data from the DHIS2 database into an R data frame and perform some basic calculations.