# repvisforODK: Quickly visualize your ODK data in R

**URL:** <https://forum.getodk.org/t/repvisforodk-quickly-visualize-your-odk-data-in-r/36564>\
**Category:** Showcase\
**Created:** [January 28, 2022, 12:36pm UTC](https://forum.getodk.org/t/repvisforodk-quickly-visualize-your-odk-data-in-r/36564 "2022-01-28T12:36:34Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![lucidviews](https://getodk.b-cdn.net/user_avatar/forum.getodk.org/lucidviews/32/16541_2.png) [@lucidviews](https://forum.getodk.org/u/lucidviews)\
**Post date:** [January 28, 2022, 12:36pm UTC](https://forum.getodk.org/t/repvisforodk-quickly-visualize-your-odk-data-in-r/36564/1 "2022-01-28T12:36:34Z")

</div>

For the past 5 month I was doing an internship with the Swiss Tropical and Public Health institute and my main project was developing an R package called repvisforODK which is in some way a continuation of what @chrissyhroberts showcased [here](https://forum.getodk.org/t/basic-data-analysis-with-r-scripts-markdown-dashboard/33544).

## Intro

The idea of **repvisforODK** was to develop a quick way to visualize data which is stored on ODK Central by creatings generic **plots** and even entire **reports**. To do so, the package leverages on a variety of other external R packages. I largely relied on [ruODK](https://docs.ropensci.org/ruODK/reference/ruODK-package.html) (@Florian_May) for the interaction with the ODK Central API and both [ggplot2](https://ggplot2.tidyverse.org/index.html) & [plotly](https://plotly.com/r/) for plotting.  
  
repvisforODK was developed to be accessible not only for people with but also for people without coding skills. Thus, repvisforODK can be used in **two ways** :

1. **Code solution** : repvisforODK contains several functions that create plots for different question types. These functions can be used individually which enables the user to use them in whatever way fits best for their use case - visualize data on the fly, integrate in already existing code, create a new personalized report etc.
2. **No Code solution** : All functions of repvisforODK are united in an integrated shiny app. The app provides an interface where the user can connect to ODK Central, select the visualizations they desire, set the required parameters and ultimately generate an html report.

* * *

## Examples

Here are some exemplary images of the app and of some of the plots you can generate with just one line of code.

### Plots

**Submissions Over Time Line Chart (Cumulative)**

 ![Line Chart](https://getodk.b-cdn.net/uploads/default/original/3X/d/d/dd25627751f9fca49f4fd23ca06bf54dd11e3dfc.png)

**Day of Week / Time of Day Heat Map**

 ![Heat Map](https://getodk.b-cdn.net/uploads/default/original/3X/f/b/fbeeeee08786db79d2e08b08d7e6a18e9ff7a886.png)

**Multiple Choice Question Bar Chart**

 ![Bar Chart](https://getodk.b-cdn.net/uploads/default/original/3X/2/a/2ae6fa594f2572e3dee7234ab2be95054c738b2e.png)

### App

**1st Tab:** Here you connect to ODK Central to get data

 ![Tab 1](https://getodk.b-cdn.net/uploads/default/original/3X/b/a/ba0e7a5815fe7d846e033d9d733c7e4a69a56510.png)  
  
**2nd Tab:** Now it's time to select the plots you want to have in your report  
 ![Tab 2](https://getodk.b-cdn.net/uploads/default/original/3X/3/3/331540aea2776a91d956470d88d2267361f9ff4d.png)  
  
**3rd Tab:** Just specifying some parameters before you can generate your report  
 ![Tab 3](https://getodk.b-cdn.net/uploads/default/original/3X/1/e/1e63c71349cef9efe98f4f25ca3e5f3a31ea11c5.png)  
  
If you want to learn more, you can visit the [GitHub](https://github.com/SwissTPH/repvisforODK). To get a good overview of the package and the app, I can recommend you to have a look at the recorded demo event which can be downloaded [here](https://github.com/SwissTPH/repvisforODK/tree/main/media/demo_videos).

* * *

## Installation

The development version from [GitHub](https://github.com/SwissTPH/repvisforODK) can be installed using:

```r
require("devtools")
devtools::install_github("swisstph/repvisforODK")

```

To install the dependency [ruODK](https://docs.ropensci.org/ruODK/reference/ruODK-package.html), you can use:

```r
# Enable the rOpenSci universe
options(repos = c(ropensci = 'https://ropensci.r-universe.dev',
                  CRAN = 'https://cloud.r-project.org'))
install.packages('ruODK')

```

If you run into further problems when attempting to install the package, you can check out the [how-to-install video tutorial](https://github.com/SwissTPH/repvisforODK/tree/main/media/demo_videos). If this doesn't help, feel free to leave a post in the discussion section.

Cheers,  
Lucas

---

<div class="post-metadata">

**Author:** ![Florian\_May](https://getodk.b-cdn.net/user_avatar/forum.getodk.org/florian_may/32/7758_2.png) [@Florian\_May](https://forum.getodk.org/u/Florian_May)\
**Post date:** [January 28, 2022, 1:25pm UTC](https://forum.getodk.org/t/repvisforodk-quickly-visualize-your-odk-data-in-r/36564/2 "2022-01-28T13:25:00Z")

</div>

This is amazing. Video tutorial? Shiny app? Nice work, can't wait to give it a whirl!

---

<div class="post-metadata">

**Author:** ![lucidviews](https://getodk.b-cdn.net/user_avatar/forum.getodk.org/lucidviews/32/16541_2.png) [@lucidviews](https://forum.getodk.org/u/lucidviews)\
**Post date:** [January 31, 2022, 7:42pm UTC](https://forum.getodk.org/t/repvisforodk-quickly-visualize-your-odk-data-in-r/36564/3 "2022-01-31T19:42:52Z")

</div>

UPDATE: We removed the recording form the GitHub repo because it got super slow. You can now stream the recording [here](https://drive.switch.ch/index.php/s/9z47qC2PoN82KEX) (-:

---

<div class="post-metadata">

**Author:** ![marabenta](https://getodk.b-cdn.net/user_avatar/forum.getodk.org/marabenta/32/29219_2.png) [@marabenta](https://forum.getodk.org/u/marabenta)\
**Post date:** [February 25, 2022, 7:12am UTC](https://forum.getodk.org/t/repvisforodk-quickly-visualize-your-odk-data-in-r/36564/4 "2022-02-25T07:12:11Z")

</div>

Hi, this looks great. is it possible to connect to data held in Aggregate or Postgres?

---

<div class="post-metadata">

**Author:** ![lucidviews](https://getodk.b-cdn.net/user_avatar/forum.getodk.org/lucidviews/32/16541_2.png) [@lucidviews](https://forum.getodk.org/u/lucidviews)\
**Post date:** [February 25, 2022, 9:46am UTC](https://forum.getodk.org/t/repvisforodk-quickly-visualize-your-odk-data-in-r/36564/5 "2022-02-25T09:46:40Z")

</div>

Hi Simon,

The app only connects to ODK Central but in R the plot-generating functions of the package also accept data frames and csv files as data inputs.  
Unfortunately, direct connections to Aggregate or Postgres are not supported.

---

<div class="post-metadata">

**Author:** ![Dushime](https://getodk.b-cdn.net/letter_avatar_proxy/v4/letter/d/b5a626/32.png) [@Dushime](https://forum.getodk.org/u/Dushime)\
**Post date:** [March 28, 2022, 6:34am UTC](https://forum.getodk.org/t/repvisforodk-quickly-visualize-your-odk-data-in-r/36564/6 "2022-03-28T06:34:17Z")

</div>

The video was deleted.

How Can I get the video ?

---

<div class="post-metadata">

**Author:** ![mathieubossaert](https://getodk.b-cdn.net/user_avatar/forum.getodk.org/mathieubossaert/32/6131_2.png) [@mathieubossaert](https://forum.getodk.org/u/mathieubossaert)\
**Post date:** [March 28, 2022, 7:58am UTC](https://forum.getodk.org/t/repvisforodk-quickly-visualize-your-odk-data-in-r/36564/7 "2022-03-28T07:58:43Z")

</div>

@Dushime , the video is now here :

> [@lucidviews](#):
>
> UPDATE: We removed the recording form the GitHub repo because it got super slow. You can now stream the recording [here](https://drive.switch.ch/index.php/s/9z47qC2PoN82KEX) (-:
