Code Monkey home page Code Monkey logo

prolific.api's Introduction

prolific.api

This is an R-Package for creating and managing empirical crowd-sourcing studies via API access to the Prolific platform.

It implements a number of user-friendly functionalities for creating and managing potentially large numbers of studies on the Prolific crowd-sourcing platform via its API.

Object classes

prolific.api provides three ReferenceClasses to access the Prolific API, namely api_access, prolific_study and prolific_prescreener. An overview is provided below.

api_access objects

provide functionalities for accessing the API, which requires to specify a valid API token.

prolific_study objects

represent studies to be created or managed on Prolific. Users can create new studies, or retrieve existing studies from Prolific and apply updates to them.

prolific_prescreener objects

characterize the participants to be selected for a certain prolific_study, i.e. the requirements that a person needs to meet to be recruited for the prolific_study.

Authentication

A researcher account on Prolific is required to use the functionalities of this package. To use this account, a valid Prolific API token must be specified for authentication. These tokens are \emph{workspace-specific}. Once you chose the correct workspace Prolific web UI, the tokens can be managed in the Settings -> Go to API token page menu.

prolific.api's People

Contributors

simon-lenau avatar

Watchers

 avatar

prolific.api's Issues

access "studies" endpoint fails, but used to work.

Problem: access "studies" endpoint fails, but used to work. Error messages for as_list TRUE and FALSE are shown.

prolific_api_access <- api_access(api_token = Sys.getenv('token'))

access(
prolific_api_access,
endpoint = "studies",
method = "get",
as_list = TRUE
)

Warning: Some columns are a multi-column type (such as a matrix column): [7]. setDT will retain these columns as-is but subsequent operations like grouping and joining may fail. Please consider as.data.table() instead which will create a new column for each embedded column.Error in data.table::setDT(output) :
All elements in argument 'x' to 'setDT' must be of same length, but the profile of input lengths (length:frequency) is: [2:1, 76:14]
The first entry with fewer than 76 entries is 7

access(
prolific_api_access,
endpoint = "studies",
method = "get",
as_list = FALSE
)

Error in output$results : $ operator is invalid for atomic vectors

Suggestion: Vignette description for exporting demographic data

One of my main use cases for the package was to be able to download the participants' demographic data into R. It would be great to add an example of how to do this to a vignette. I figured it out from the API documentation. This is the approach I used:

api <- api_access(api_token = "<your_api_token>")
demo <- api$access(
  endpoint = c("studies", "<your_study_id>", "export"),
  method = "get"
)
demo_df <- read.csv(text = demo)

Invalid API token?

I loaded the prolific.api package and used api_access(api_token = "X") where X is the API token generated on my workspace Settings page. I get back the error "API token status: invalid API access failed!". Am I doing something wrong, or has the API changed?

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.