复制鉴定示例MTurkR

复制鉴定示例MTurkR,r,mechanicalturk,R,Mechanicalturk,我正在尝试使用包MTurkR(使用OS MAC 10.9)通过R向亚马逊的mTurk发布资格考试 当我尝试为发布的资格认证示例复制该示例时,我收到以下错误消息: Error in CreateQualificationType(name = "A new coding test 2", description = "Test of coding ability", : No Namespace specified in 'test' 根据示例,我的代码和输出如下: # load Questi

我正在尝试使用包
MTurkR
(使用OS MAC 10.9)通过R向亚马逊的mTurk发布资格考试

当我尝试为发布的资格认证示例复制该示例时,我收到以下错误消息:

Error in CreateQualificationType(name = "A new coding test 2", description = "Test of coding ability",  : No Namespace specified in 'test'
根据示例,我的代码和输出如下:

# load QuestionForm and AnswerKey
QuestionForm <- paste0(scan(file="/Users/Desktop/QualExam.xml", what="character", sep="\n"), collapse="")
   >Read 3 items
AnswerKey <- paste0(scan(file="/Users/Desktop/QualExamAnswers.xml", what="character", sep="\n"), collapse="")
   >Read 3 items

# create new QualificationType
newqual <- CreateQualificationType(name="A new coding test 2",
    description="Test of coding ability",
    status="Active",
    test.duration=seconds(hours=1),
    test=QuestionForm,
    answerkey=AnswerKey,
    validate.test=TRUE,
    validate.answerkey=TRUE,
    sandbox=TRUE)
   >Error in CreateQualificationType(name = "A new coding test 2", description = "Test of coding ability",  : No Namespace specified in 'test'
我的会话信息如下所示:

sessionInfo()
R version 2.15.1 (2012-06-22)
Platform: i386-apple-darwin9.8.0/i386 (32-bit)

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] MTurkR_0.4

loaded via a namespace (and not attached):
[1] digest_0.6.4   RCurl_1.95-4.1 XML_3.98-1.1 

请帮助。

这不起作用,因为R未更新(您可以更新R)。您还必须安装

.xml
文件经过验证,示例运行正常。我的
sessionInfo()
信息如下:

> sessionInfo()
R version 3.1.2 (2014-10-31)
Platform: x86_64-apple-darwin13.4.0 (64-bit)

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] MTurkR_0.6

loaded via a namespace (and not attached):
[1] bitops_1.0-6   digest_0.6.8   RCurl_1.95-4.5 tcltk_3.1.2    tools_3.1.2    XML_3.98-1.1  

你完全照搬了这些例子吗?我不能完全复制这个。您还可以更新您的问题以包含
sessionInfo()
的输出吗?感谢您编辑@Thomas链接。我已使用尝试运行此示例时遇到的错误的更新信息修改了问题。
QuestionForm\u example.xml
但缺少DOCTYPE和字符编码。这就是问题所在吗?从更新MTurkR安装开始。您在当前版本的后面有几个版本。再试一次。如果这还不行,我怀疑这可能是一个特定于平台的问题。我要进一步调查,谢谢。。。这是R版本的问题,我没有运行Xquartz。我已经更新了我的答案,以反映我所做的更改,并表示它现在正在工作。
> sessionInfo()
R version 3.1.2 (2014-10-31)
Platform: x86_64-apple-darwin13.4.0 (64-bit)

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] MTurkR_0.6

loaded via a namespace (and not attached):
[1] bitops_1.0-6   digest_0.6.8   RCurl_1.95-4.5 tcltk_3.1.2    tools_3.1.2    XML_3.98-1.1