Learn R Programming

MTurkR (version 0.2)

GetAssignment: Get Assignment(s)

Description

Get an assignment or multiple assignments for one or more HITs (or a HITType) as a dataframe.

Usage

GetAssignment(	assignment = NULL, hit = NULL, hit.type = NULL, status = NULL, 
				return.all = FALSE, pagenumber = "1", pagesize = "10", 
				sortproperty = "SubmitTime", sortdirection = "Ascending", 
				keypair = credentials(), print = TRUE, browser = FALSE, 
				log.requests = TRUE, sandbox = FALSE, return.assignment.dataframe = TRUE)

Arguments

assignment
An optional character string specifying the AssignmentId of an assignment to return.
hit
An optional character string specifying the HITId whose assignments are to be returned, or a vector of character strings specifying multiple HITIds all of whose assignments are to be returned.
hit.type
An optional character string specifying the HITTypeId of one or more HITs whose assignments are to be returned.
status
An optional character string (of Approved,Rejected,Submitted), specifying whether only a subset of assignments should be returned. If NULL, all assignments are returned (the default). Only ap
return.all
If TRUE, all available assignments are returned. Otherwise, only assignments falling within the specified pagenumber and pagesize search results are returned.
pagenumber
An optional character string indicating which page of search results should be returned (only appropriate when specifying a single HITId). Most users can ignore this.
pagesize
An optional character string indicating how many search results should be returned by each request (only appropriate when specifying a single HITId), between 1 and 100. Most users can ignore this.
sortproperty
One of AcceptTime, SubmitTime, AssignmentStatus. Ignored if return.all=TRUE. Most users can ignore this.
sortdirection
Either Ascending or Descending. Ignored if return.all=TRUE. Most users can ignore this.
keypair
A two-item character vector containing an AWS Access Key ID in the first position and the corresponding Secret Access Key in the second position. Set default with credentials.
print
Optionally print the results of the API request to the standard output. Default is TRUE.
browser
Optionally open the request in the default web browser, rather than opening in R. Default is FALSE.
log.requests
A logical specifying whether API requests should be logged. Default is TRUE. See readlogfile for details.
sandbox
Optionally execute the request in the MTurk sandbox rather than the live server. Default is FALSE.
return.assignment.dataframe
A logical specifying whether the Assignment dataframe should be returned. Default is TRUE.

Value

  • Optionally a dataframe containing Assignment data, including workers responses to any questions specified in the question parameter of the CreateHIT function.

Details

This function returns the requested assignments. The function must specify an AssignmentId xor a HITId xor a HITTypeId. If an AssignmentId is specified, only that assignment is returned. If a HIT or HITType is specified, default behavior is to return all assignments through a series of sequential (but invisible) API calls meaning that returning large numbers of assignments (or assignments for a large number of HITs in a single request) may be time consuming. GetAssignments(), assignment(), and assignments() are aliases.

References

http://docs.amazonwebservices.com/AWSMechTurk/latest/AWSMturkAPI/ApiReference_GetAssignmentOperation.html{API Reference: GetAssignment} http://docs.amazonwebservices.com/AWSMechTurk/latest/AWSMturkAPI/ApiReference_GetAssignmentsForHITOperation.html{API Reference: GetAssignmentsForHIT }

See Also

GetHIT ApproveAssignment ApproveAllAssignments RejectAssignment

Examples

Run this code
GetAssignment(assignments="26XXH0JPPSI23H54YVG7BKLEXAMPLE")
GetAssignment(hit="2MQB727M0IGF304GJ16S1F4VE3AYDQ",return.all=TRUE)
GetAssignment(hit.type="2FFNCWYB49F9BBJWA4SJUNST5OFSOW",return.all=FALSE,pagenumber="1",pagesize="50")

Run the code above in your browser using DataLab