Description Usage Format Details Methods Active Fields See Also Examples
An R6 class for managing Crowdflower jobs using reference semantics
1 2 3 |
An object of class R6ClassGenerator
of length 24.
This is an experimental R6 interface for working with Crowdflower jobs. The advantage of using a “Job”-class object to manage your Crowdflower operations is that the local object is always up-to-date with remote changes and operations can be performed without specifying a job identifier. The semantics of R6 are slightly different from traditional R code, but will quickly make sense after working through some examples.
add_data(data, ...)
Add a data.frame or CSV file of data to a job using job_add_data
convert_gold()
Convert uploaded questions to “gold questions” using job_convert_gold
launch(channel = , units = 100)
Launch the job using job_launch
.
pause()
Pause the job using job_pause
resume()
Resume the (paused) job using job_resume
cancel()
Cancel the job using job_cancel
get_unit(unit)
Get data on a given unit (row) from the job using results_get
get_results(n = Inf)
Return a specified number of results from the job using results_get
. Default is all results.
get_report()
Return a report document using report_get
. Default is the “full” report. report_regenerate
is called automatically.
contributor
Initialize a new R6 “Contributor” object in order to flag()
, unflag()
, reject()
, bonus()
, or notify()
a contributor (worker).
update(...)
Update features of a job using job_update
sync()
Synchronize local information in the R6 object with Crowdflower. This is performed automatically during various method calls but may be useful to call directly to make sure all job details are up to date.
Active fields are like list elements, but are “active” meaning that they are updated against the Crowdflower API each time they accessed. This means that they are always current. They can also be set using the standard <-
operator.
auto_launch
A logical specifying whether to auto-launch the job.
channels
A list of Crowdflower channels on which the job is available.
cml
A character string contianing the Crowdflower Markup Language (CML) describing the job.
instructions
A character string containing instructions shown to the worker.
legend
A list specifying the generated keys that will be submitted with your form. This cannot be modified.
payment_cents
A numeric value specifying the payment per unit.
tags
A character vector of tags for the job.
time_per_assignments
An integer specifying the length of time available per assignment, in seconds. Default is 1800 (i.e., 30 minutes).
title
A character string specifying the job's title.
units_per_assignment
A numeric value specifying the number of units per assignment.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 | ## Not run:
# initialize a 'job' object for an existing job
job <- Job$new(id = "examplejobid")
job
## add data to job
job$add_data(data.frame(x = 1:3))
## get and set a job's title
job$title
job$title <- "New Title"
job$title
## control job
job$launch()
job$pause()
job$resume()
job$cancel()
## get results
job$get_results()
# initialize a 'contributor' object
worker <- job$contributor("example_contributor")
## notify the worker
worker$notify("Hello, worker!")
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.