knitr::opts_chunk$set( collapse = TRUE, comment = "#>" )
library(repvisforODK)
The idea of repvisforODK was to develop a quick way to visualize data which is stored on ODK Central by creating custom reports. To do so, the package leverages on a variety of other external R packages. Of paramount importance are ruODK for the interaction with the ODK Central API and both ggplot2 & plotly 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:
This section provides an overview of all functions in repvisforODK. For more detailed information, visit the help page of a function using ?[FUNCTION NAME]
.
repvisforODK offers 4 functions that visualize metadata of the entire form (1 plot per form) and 3 question-specific functions for responses of the surveyees (1 plot per question of respective question type).
General plots:
submission_goal_donut()
\
Pie Chart showing received vs. missing submissions referring to a submission goal set by the user.submissions_timeseries_lineplot()
\
Line chart showing the number of received submissions over the course of the data collection period.heatmap_wday_hourofday()
\
Heat map of the number of submissions per weekday and hour.heatmap_calendar()
\
Heat map of the number of submissions on each day of the data collection period.Question plots:
single_choice_question_pie()
\
Pie Chart showing the selection percentage of each choice of a single-choice question. Function automatically identifies all single-choice questions in the form and generates a plot for each of them.multiple_choice_question_bar()
\
Stacked bar chart showing the selection percentage of each choice of a multiple-choice question. Function automatically identifies all multiple-choice questions in the form and generates a plot for each of them.free_text_wordcloud()
\
Generates a wordcloud based on text from a free text question. Function doesn't automatically identifies free text questions in the form - has to be specified by the user.The shiny app consists of 2 separate components - the user interface and the server (back-end). Each component's code is accessed by calling the respective function. On top that, there is a third function that calls the UI and the server and launches the app.
ui()
\
Contains the shiny code for the user interface of the app.server()
\
Contains the shiny code for the back-end of the app.run_app()
\
Calls both of the above functions and launches the shiny app.Apart from visualizing data, repvisforODK also offers an efficient solution for only getting data from ODK Central which is not yet part of data a user is using already. This is useful in situations where a user is already working with ODK Central data in an R session. Instead of downloading all the data of a form which is available, the user can use the following functions to restrict the downloaded submissions to only the ones which are not yet in the data.
get_new_submissions()
\
Takes existing ODK data (data frame or csv) and downloads only new submissions. In contrast to get_new_submissions_odata()
, this function uses the ODK Central REST-API endpoint and not the ODATA endpoint. For detailed information on the implications of the latter visit the function's help page.get_new_submissions_odata()
\
Takes existing ODK data (data frame or csv) and downloads only new submissions. In contrast to get_new_submissions_odata()
, this function uses the ODK Central ODATA endpoint and not the REST-API endpoint. For detailed information on the implications of the latter visit the function's help page.find_missing_instanceIDs()
\
Takes existing ODK data and finds all instance IDs that are already on ODK Central but not in the data. This function is used within get_new_submissions().This section contains all non-private functions that are primarily used in other functions but could still be useful for the user to use on their own.
collection_period()
\
Returns the earliest and latest value of a date/time stamp column.identify_choice_questions()
\
Finds all questions in an ruODK extended form schema that are choice question (single or multiple).setup_ruODK()
\
Connects R session to a form on ODK Central which is required in order to use most ruODK functions. Thus, all repvisforODK functions only work if this connection has been established.Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.