Learn R Programming

MTurkR (version 0.8.0)

GetHIT: Get HIT

Description

Retrieve various details of a HIT as a data frame. What details are returned depend upon the requested ResponseGroup.

Usage

GetHIT(hit, response.group = NULL,
       return.hit.dataframe = TRUE, return.qual.dataframe = TRUE,
       verbose = getOption('MTurkR.verbose', TRUE), ...)

HITStatus(hit = NULL, hit.type = NULL, annotation = NULL, verbose = getOption('MTurkR.verbose', TRUE), ...)

Arguments

hit

An optional character string specifying the HITId of the HIT to be retrieved. Must specify hit xor hit.type xor annotation.

hit.type

An optional character string specifying the HITTypeId (or a vector of HITTypeIds) of the HIT(s) to be retrieved. Must specify hit xor hit.type xor annotation, otherwise all HITs are returned in HITStatus.

annotation

An optional character string specifying the value of the RequesterAnnotation field for a batch of HITs. This can be used to retrieve all HITs from a “batch” created in the online Requester User Interface (RUI). To use a batch ID, the batch must be written in a character string of the form “BatchId:78382;”, where “73832” is the batch ID shown in the RUI. Must specify hit xor hit.type xor annotation, otherwise all HITs are returned in HITStatus.

response.group

An optional character string (or vector of character strings) specifying what details of each HIT to return of: “Request”, “Minimal”, “HITDetail”, “HITQuestion”, “HITAssignmentSummary”. For more information, see Common Parameters and HIT Data Structure.

return.hit.dataframe

A logical indicating whether the data frame of HITs should be returned. Default is TRUE.

return.qual.dataframe

A logical indicating whether the list of each HIT's QualificationRequirements (stored as data frames in that list) should be returned. Default is TRUE.

verbose

Optionally print the results of the API request to the standard output. Default is taken from getOption('MTurkR.verbose', TRUE).

...

Additional arguments passed to request.

Value

Optionally a one- or two-element list containing a data frame of HIT details and, optionally, a list of each HIT's QualificationRequirements (stored as data frames in that list in the order that HITs were retrieved.).

Details

GetHIT retrieves characteristics of a HIT. HITStatus is a wrapper that retrieves the Number of Assignments Pending, Number of Assignments Available, Number of Assignments Completed for the HIT(s), which is helpful for checking on the progress of currently available HITs. Specifying a hit.type causes the function to first search for available HITs of that HITType, then return the requested information for each HIT.

gethit() and hit() are aliases for GetHIT. status() is an alias for HITStatus.

References

API Reference

See Also

GetHITsForQualificationType

GetReviewableHITs

SearchHITs

Examples

Run this code
# NOT RUN {
# register HITType
hittype <- 
RegisterHITType(title="10 Question Survey",
                description=
                "Complete a 10-question survey about news coverage and your opinions",
                reward=".20", 
                duration=seconds(hours=1), 
                keywords="survey, questionnaire, politics")

a <- GenerateExternalQuestion("http://www.example.com/","400")
hit1 <- 
CreateHIT(hit.type = hittype$HITTypeId, question = a$string)

GetHIT(hit1$HITId)
HITStatus(hit1$HITId)

# cleanup
DisableHIT(hit1$HITId)
# }
# NOT RUN {
# Get the status of all HITs from a given batch from the RUI
HITStatus(annotation="BatchId:78382;")
# }

Run the code above in your browser using DataLab