GithubHelp home page GithubHelp logo

jatosr's Introduction

jatosR

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.

Installation

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")

Example

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")

jatosr's People

Contributors

jirilukavsky avatar

Watchers

 avatar

jatosr's Issues

Add jspsychdemo

JATOS server can store data coming from different frameworks. The jatosR package can be used regardless of the employed framework. If the stored JSON data come from the jsPsych framework, the data can be further processed with jspsychread package.

New function could offer the processing of data$raw column coming from the process_results function.

Results coming from jsPsych are being processed by jspsychread into tibbles. These tibbles should be nested to keep the original structure (like one line per study session).

Process metadata only

The function process_results could tolerate null results variable. In that case, metadata will be processed, but no raw column added.

It is useful to separate downloading of the metadata and data, because in some cases the data objects can be large and getting metadata is sufficient (e.g., for checking participation).

Offer smarter way to store tokens

Currently, tokens are variables values and the design tempts users to store them in code. This is a dangerous practice, because user can unintentionally share the token or store it in GitHub.

Better options like keyring package (or alternatives discussed here) should be used in future.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.