获取命中状态,而R中

获取命中状态,而R中

问题描述:

创建使用Mturkr包HIT
library("MTurkR") 
    credentials(c("EXAMPLEAWSKEY","EXAMPLEAWSSCERETKEY")) 
    AccountBalance() 
    #Fetching AccountBalance=$0.00 

    # First set qualifications 
    # ListQualificationTypes() to see different qual types 
    qualReqs = paste(

     # Set Location to US only 
     GenerateQualificationRequirement(
      "Location","==","US"), 

     sep="") 

    # Create new batch of hits: 
    newHIT = CreateHIT(

     # layoutid in sandbox: 
     hitlayoutid="EXAMPLEHITLAYOUTID", 
     sandbox=T, 
     annotation = "HET Experiment with Pre-Screen", 
     assignments = "1200", 
     title="Rate this hypothetical representative", 
     description="It's easy, just rate this 
      hypothetical representative on how well 
      she delivers funds to his district", 
     reward=".50", 
     duration=seconds(hours=4), 
     expiration=seconds(days=7), 
     keywords="survey, question, answers, research, 
       politics, opinion", 
     auto.approval.delay=seconds(days=15), 
     qual.reqs=qualReqs 
    ) 

    # Get HITId (record result below) 
    newHIT$HITId 

    HITStatus(hit="EXAMPLEHITID") 
    #not able to fetch HIT STATUS. 
    #I Can see HIT been Created in Worker Sandbox, But after submitting the by the worker I am not able to fetch anything. 

review = GetAssignments(hit="Example HITID", 
    status="Submitted", return.all=T) 

我收到以下错误:获取命中状态,而R中

Error (AWS.MechanicalTurk.HITDoesNotExist): Hit 3IV1AEQ4DRV9ICWQ5F0YS4QBNVOJ85 does not exist. (1444808078544)

# Error in while (request$total > runningtotal) { : # missing value where TRUE/FALSE needed

这一个非常简单,实际上,尽管不是非常翔实的(第二)的错误信息。您已经在沙盒中创建了一个HIT,但您正试图检查它在活动服务器上的状态,它不存在。

您可以通过将sandbox = TRUE(或sandbox = FALSE)参数传递给每个函数来解决此问题,并在所有代码中保持一致。一个更简便的方法是指定一个全局选项:在你的代码,然后你就可以轻松切换的开始和关闭需要

options(MTurkR.sandbox = TRUE)

+0

感谢您的帮助。 –