Simple R package for pulling and exporting forms from an ODK server

I started working on some functions to pull and export forms from a odk server about a year ago - but have recently begun working on it again. It's an R package that uses ODK Briefcase to download data from a server, like Kobo or other.

The figured package is not wildly innovative or elegant, as it basically just generates and runs the command line interface that Get ODK describes in the documentation here, except in the R Console.

However - there are a few key reasons why I use it:

  • Because R: I'm an avid R user, and this simplifies my workflow dramatically. I can pull fresh datasets within your R script, rather manually interacting with the ODK Briefcase GUI, web portal, manually running the command line, or creating a batch file.
  • Collaboration: It allows me to help other people use my R code directly, and to pull the most fresh dataset from a server. I've found that some formats (like dates) are changed based on the platform (kobotoolbox vs. getodk vs. ONA) and file format (csv vs. excel vs. other). By pulling directly via ODK, using this code - we are all working with data formatted exactly the same way, and can collaborate on code.
  • Ease of setup While this package does require some pre-reqs to be downloaded, it will automatically download and setup the ODK briefcase package. You can manually assign folder locations, but if none is specified - the package will work just fine and put storage and export locations within your working directory. This has helped eliminate one more step in collaborating with colleagues.
  • Tailored to my preferences: This might not be particularly interesting to others, but it simplifies code for the options I normally use. That is, I normally remove group names, overwrite previous csv exports, etc. The functions default to my preferences, though you can change them to yours. Like most R packages, help documentation can be accessed with the ? for more information on how these options work.

There's a few other functions in the package which I use frequently, and have documention, but folks here may or may not be interested in them. The relevant functions I've built out so far are pullForm and exportForm. I have not built in the pushForm, because I rarely use it, but if even one other person would use the package, and find this useful - I'd be happy to add the function in.

Other packages have similar functionality (although I'm seeing odkr was removed from CRAN) and may be more elegant more elegant (see koboloadeR). These may be more appropriate for some use cases. I built this because odkr lacked functionality to export encrypted forms. The figured package also includes some basic functionality/options that are available in ODK Briefcase but not in some of these more complex packages. I would also be curious if others have other packages to recommend that have similar functionality. If someone's already developed something good - I might choose to abandon this and use theirs!

For anyone interested, information on how to download the package can be found on the github repository.

3 Likes

Thanks for sharing your package, and welcome to the R/ODK family!
Here's a comparison of ODK/OData related R packages (I'll add yours to that list): https://docs.ropensci.org/ruODK/articles/comparison.html

1 Like

Thanks!

I should also note that this package has only been tested on windows.

1 Like

Thanks @Florian_May, I may actually discontinue development on the ODK Briefcase functions within this package. I've spoken with @Ernest, and (if my pull-request is good enough) will likely instead contribute to the odkr package, rather than splintering.

1 Like