Code to process survey data collected via KoBoToolbox for the Play & Learning Across a Year (PLAY) Project.
PLAY project researchers use KoBoToolbox to collect data from participant families. Data from all sessions at all PLAY data collection sites is pushed to a common set of files on the KoBoToolbox server. We need to i) download, ii) parse, iii) clean, and iv) export these files into forms more suitable for data analysis.
- Clone the repository to a new RStudio project.
- Install the
renv' package viainstall.packages('renv')`. - Install the package dependencies via
renv::activate()and thenrenv::restore(). - Create (blank) data directories via
source('R/functions.R')and thencreate_data_dirs(). - Add the KoBoToolbox API key to
~/.Renviron. - Restart the R environment.
- Download the data via
targets::make() - Generate the report via
bookdown::render_book('src'). - View the report in
docs/index.html.
As of 2023-06-07, I am moving various functions to take advantage of the box
package. This encapsulates functions into modules that is useful for the project.
The modules are stored in play/ as distinct R files that contain groups of
related functions. For example, play/ecbq.R is used to access the functions
associated with the Early Childhood Behavior Questionnaire (ECBQ) data.
To access these modules, load them using, for example box::use(play/ecbq).
To unload a module, use box::unload(ecbq).
R/: Sets of R functions that support workflow._old/: deprecated*.Rfilesfunctions.Ractive functions.
_targets/: Files related to this project's use of the{targets}package._targets.R: active targets file. surveys.docs/: Output files for bootstrap4-styled gitbook; the output ofbookdown::render(). See https://PLAY-behaviorome.github.io/KoBoToolbox/ for the rendered site.renv/: Files supporting the project's use of therenvpackage to support computational reproducibility.renv.lock: file used byrenvto maintain list of package dependencies.preamble.tex: file used for rendering PDF version of web book.srcindex.Rmd,01-setup.Rmd,02-screening.Rmd,03-home-visit.Rmd,04-data-dictionary.Rmd,05-post-visit-notes.Rmd, and06-visualization.Rmd: Files that form the basis of the web book.bookdown.ymlandoutput.yml: parameter files used bybookdownto render web book.include/: Assets to be included in rendered web book.bib/: Reference filescss/: CSS filesimg/: Image files.
- There are a set of data files and intermediates that are not synched to GitHub for privacy reasons.