The goal of jatosR is to help with downloading data from JATOS server (for example from MindProbe). The package provides a thin wrapper around JATOS api.
The package simplifies the process by eliminating the need to download data manually. This improves reproducibility, simplifies team collaboration and enables building of dashboards showing the progress of data collection.
The package is in active development. You can install the current version from GitHub with following code:
# Install devtools package if necessary
if(!"devtools" %in% rownames(installed.packages())) install.packages("devtools")
# Install the stable verion from GitHub
devtools::install_github("visionlabels/jatosR")
This is a basic example which shows you how to solve a common problem:
library(jatosR)
url <- "https://www.myjatosinstance.org"
# don't publish your token!
token <- "Bearer jap_xXxXxXxXxXxXxXxXxXxXxXxXxXxXxXxXxXxXx"
cc <- define_connection(url, token)
test_connection(cc)
meta <- get_metadata(cc, batch_id = 100)
results <- get_results(cc, batch_id = 100)
r <- process_results(meta, results)
r$data
If you want to check the process without API token and living JATOS instance:
library(jatosR)
# returns demo data and saves a copy of zipped data into working directory
demo <- prepare_demo()
r <- process_results(demo$meta, demo$results)
r$data
clean_demo() # cleans the local zipped data
You can also check the final state by:
library(dplyr)
library(jatosR)
data("demo_srt_processed")