Git Product home page Git Product logo

kobocruncher's Introduction

{kobocruncher}

:name status badge IndicatorCalc status badge

An organized workflow generating 'Rmd' files from an extended 'xlsform' questionnaire structure to facilitate survey data crunching.

{kobocruncher} support organised data analysis workflow, to conduct data discovery and analysis for data collected through KoboToolbox, ODK, ONA or any xlsform compliant data collection platform.

You can use this tool through a dedicated shiny App: https://rstudio.unhcr.org/kobocruncher/

This R package first builds on the capacity of UNHCR Kobo server but it can also be used from any structured dataset. It comes as a companion tool to the Integrated Framework for Household Survey.

Tutorial

{kobocruncher} aims at helping humanitarian data analysts to focus in data interpretation by saving the time needed to quickly generate the graphs and charts required to discover insights from a dataset. It also ensure analysis reproducibility through a separation of the analysis configuration and the analysis process. The package allows to account for sample weights and hierarchical dataset structure (both capacities that are not available through the default reporting engine or the excel-analyzer).

Presentations / tutorials for a one day training workshop are accessible here:

Install

Beside the shinyApp, you can install the package on Rstudio.

If you are on Windows, you will first need to install Rtools on the top of R and Rstudio in order to install the package locally.

install.packages("pak")
pak::pkg_install("edouard-legoupil/kobocruncher")  

Configure authentication token

The {riddle} package is used to ensure integration with RIDL - UNHCR Internal Data Repository. It requires you to add your API token and store it for further use. The easiest way to do that is to store your API token in your .Renviron file which is automatically read by R on startup.

You can retrieve your API TOKEN in your user page.

To use the package, you’ll need to store your RIDL API token in the RIDL_API_TOKEN environment variable. The easiest way to do that is by calling usethis::edit_r_environ() and adding the line RIDL_API_TOKEN=xxxxx to the file before saving and restarting your R session.

Contributing

Contributions to the packages are welcome. Please read first the contribution guidelines, follow the code of conduct and use the issue template.

References

The package falls into the category of Automatic Data Exploration package (see an extensive review here) and mostly act as a wrapper for different specialized packages from the tidyverse .

Compare to those packages, {kobocruncher} provides:

  • An integration of all the data processing stages, not only visualization

  • An approach where most of the exploration is documented in the original xlsform used to collect the data as UNHCR standard for Survey Data Collection is based on Kobotoolbox. This allows for reproducible analysis

  • Multiple notebook templates with standard charts designed to be interpretable by a non-technical audience

  • Relabeling functions and Questions grouping ability

  • Full integration with UNHCR Brand Style

kobocruncher's People

Contributors

edouard-legoupil avatar galalh avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

kobocruncher's Issues

[Meta] Add unit tests to the package

Add unit tests to the package

How to contribute

1 - Make sure you have clone the package on your computer
2 - Checkout this issue and spot a function that has no unit tests yet
3 - Open an issue to add unit tests to that function
4 - Go back to your local {kobocruncher} and PULL ! to make sure to work from the latest version of main
5 - Create a new branch <number>-iissue-add-test-<function-name>
6 - Add a unit test
7 - Inflate and make sure the check is passing
8 - Make a commit
9 - Make a PR and assigned to Edouard
10 - When the PR is merged Edouard updates the list below

TODO list off all functions to add unit tests to

  • app_kobocruncher
  • kobo_anonymise
  • kobo_clean
  • kobo_cruncher
  • kobo_data
  • kobo_dico
  • kobo_frame
  • kobo_indicator
  • kobo_likert
  • kobo_prepare_form
  • kobo_ridl
  • label_choiceset
  • label_varhint
  • label_varname
  • plot_correlation
  • plot_header
  • plot_integer
  • plot_integer_cross
  • plot_likert
  • plot_select_multiple
  • plot_select_multiple_cross
  • plot_select_one
  • plot_select_one_cross
  • plot_text
  • template_1_exploration

Make the check pass

Currently the package check is not passing.

Here is the details of the devtools::check() outcome.

checking dependencies in R code ... WARNING
  'library' or 'require' calls not declared from:cowplot’ ‘dplyr’ ‘ggplot2’ ‘likert’ ‘tm'library' or 'require' calls in package code:cowplot’ ‘dplyr’ ‘ggplot2’ ‘likert’ ‘tmPlease use :: or requireNamespace() instead.
    See section 'Suggested packages' in the 'Writing R Extensions' manual.checking Rd cross-references ... WARNING
  Missing link or links in documentation object 'kobo_indicator.Rd':1’ ‘2See section 'Cross-references' in the 'Writing R Extensions' manual.checking package dependencies ... NOTE
  Imports includes 27 non-default packages.
  Importing from so many packages makes the package vulnerable to any of
  them becoming unavailable.  Move as many as possible to Suggests and
  use conditionally.checking installed package size ... NOTE
    installed size is  9.4Mb
    sub-directories of 1Mb or more:
      fonts   2.6Mbchecking R code for possible problems ... NOTE
  kobo_indicator: no visible global function definition foracrossUndefined global functions or variables:
    acrosschecking Rd line widths ... NOTE
  Rd file 'kobo_indicator.Rd':
    \examples lines wider than 100 characters:
                           calculation = "dplyr::if_else(datalist[[\"main\"]]$profile.country ==\"COL\", \"yes\",\"no\")")
  
  These lines will be truncated in the PDF manual.checking for non-standard things in the check directory ... NOTE
  Found the following files/directories:sample_xlsform_withindic.xlsx

Issue when using kobo_prepare_form

Hi, I'm new to this package. When trying to use the kobo_prepare_form function I get the following error:

[1] "There was an error in the xlsform preparation step!!! \n\n"
$message
[1] "replacement has 0 rows, data has 319"

$call
$<-.data.frame(*tmp*, "label.lenght", value = integer(0))

attr(,"class")
[1] "try-error"

I followed all the steps shown in the tutorial but I still cant fix this error. I was wondering if someone could help me.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.