Skip to content

Instantly share code, notes, and snippets.

@djnavarro
Created December 28, 2018 00:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save djnavarro/5264ae08573b2f883b95609756d77ab2 to your computer and use it in GitHub Desktop.
Save djnavarro/5264ae08573b2f883b95609756d77ab2 to your computer and use it in GitHub Desktop.
Typical method for tidying data from one of my jsPsych experiments hosted on Google App Engine
# Script for tidying data pulled from Google App Engine. Typically the raw format
# has a "content" field, and each entry in it is a text string describing the
# complete data set from one person in CSV format.
library(tidyverse)
my_data <- read_csv("results.csv") %>%
pull("content") %>%
map_dfr(read_csv, col_types = cols(.default = "c")) %>%
write_csv("tidy_results.csv")
# Notes:
# - the script assumes that results.csv is in the working directory
# - the script doesn't know what's in each field, so it treats everything as text
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment