README.md

rEvalKit

The goal of rEvalKit is to hasten data extraction from the EvaluationKit REST API.

Installation

rEvalKit is not on CRAN, but you can install the package with devtools:

devtools::install_github("daranzolin/rEvalKit")

Setup

First, obtain an API key by contacting EvaluationKit. Second, set your domain and key with the two helper functions below. These values will get written to your .Rprofile.

library(rEvalKit)
ek_set_token("YOUR_TOKEN_HERE")
ek_set_domin("YOUR_DOMAIN_HERE")

Available Functions

Project Raw Data

ek_project_rawdata will throw a 422 status error if the specified project is not a "General Survey Project". A workaround is to collect the raw data from each course like so:

projects <- ek_projects()

safe_get_ek_data <- safely(ek_course_rawdata)
get_project_data_safe_list <- function(projectId) {
  courses <- try(ek_project_courses(projectId), silent = TRUE)
  if (inherits(courses, "try-error")) return(NULL)
  list_args <- list(
    projectId = projectId,
    courseId = courses$id
  )
  pmap(list_args, safe_get_ek_data)
}
all_raw_data <- projects$id %>% 
  map(get_project_data_safe_list) %>%
  map_df("result")


daranzolin/rEvalKit documentation built on May 8, 2019, 1:19 p.m.