crowdflower_r6: Crowdflower Job R6 Class

Description Usage Format Details Methods Active Fields See Also Examples

Description

An R6 class for managing Crowdflower jobs using reference semantics

Usage

1
2
3

Format

An object of class R6ClassGenerator of length 24.

Details

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.

Methods

Active Fields

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.

See Also

job_create

Examples

 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)

cloudyr/crowdflower documentation built on May 13, 2019, 8:20 p.m.