2015-10-25 2 views
0
library(MTurkR) 
    options(MTurkR.sandbox = TRUE) 
    credentials(keypair=c("XXXXXX","XXXXXX")) 
    AccountBalance() 
    #BulkCreateFromTemplate 
    temp <- system.file("template.html", package = "MTurkR") 
    a <- data.frame(hittitle = c("HIT title 1", "HIT title 2", "HIT title 3"), 
        hitvariable = c("HIT text 1", "HIT text 2", "HIT text 3"), 
        stringsAsFactors = FALSE) 
    BulkCreateFromTemplate(template = temp, 
          input = a, 
          annotation = paste("Bulk From Template", Sys.Date()), 
          title = "Categorize an image", 
          description = "Categorize this image", 
          reward = ".05", 
          expiration = seconds(days = 4), 
          duration = seconds(minutes = 5), 
          auto.approval.delay = seconds(days = 1), 
          keywords = "categorization, image, moderation, category") 

Erreur j'obtiens lors de l'exécution du modèle est la suivante: Erreur dans le fichier (con, « r »): ne peut pas ouvrir la connexion En outre: un message d'avertissement: Dans le fichier (con, "r"): ne peut pas ouvrir le fichier 'http://mechanicalturk.amazonaws.com/AWSMechanicalTurkDataSchemas/2011-11-11/HTMLQuestion.xsd'>450': Invalid argumenten vrac HIT Création par modèle

#tempalte I am using is: 
<!DOCTYPE html> 
<html> 
<head> 
    <meta http-equiv='Content-Type' content='text/html; charset=UTF-8'/> 
    <script type='text/javascript' src='https://s3.amazonaws.com/mturk-public/externalHIT_v1.js'></script> 
</head> 
<body> 
    <form name='mturk_form' method='post' id='mturk_form' action='https://www.mturk.com/mturk/externalSubmit'> 
    <input type='hidden' value='' name='assignmentId' id='assignmentId'/> 
    <h1>${hittitle}</h1> 
    <p>${hitvariable}</p> 
    <p>What do you think?</p> 
    <p><textarea name='comment' cols='80' rows='3'></textarea></p> 
    <p><input type='submit' id='submitButton' value='Submit' /></p></form> 
    <script language='Javascript'>turkSetAssignmentID();</script> 
</body> 
</html> 

Répondre

0

Votre problème est dans cette ligne:

temp <- system.file("template.html", package = "MTurkR") 

"template.html" n'est pas un fichier installé avec MTurkR donc system.file() n'est pas approprié ici. Si vous essayez d'accéder à un fichier appelé "template.html" dans votre répertoire de travail (ou ailleurs sur votre ordinateur), il vous suffit de faire ce qui suit:

BulkCreateFromTemplate(template = "template.html", ... 

ainsi que les autres options passées à BulkCreateFromTemplate().

+0

Merci beaucoup pour votre aide –