【发布时间】:2015-03-04 04:57:06
【问题描述】:
我正在尝试使用包MTurkR(使用 OS MAC 10.9)通过 R 向亚马逊的 mTurk 发布资格考试。
当我尝试复制发布在here 的资格示例时,我收到以下错误消息:
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'
我完全粘贴了示例中的文本以创建 QualExam.xml 和 QualExamAnswers.xml 文件。
当我运行修改后的代码时,出现以下错误:
> QuestionForm <- paste0(readLines("/Users/Desktop/QuestionForm_Example.xml"), collapse = "")
Warning message:
In readLines("/Users/Desktop/QuestionForm_Example.xml") :
incomplete final line found on '/Users/Desktop/QuestionForm_Example.xml'
>AnswerKey <- paste0(readLines("/User/Desktop/AnswerKey_Example.xml"), collapse = "")
Warning message:
In readLines("/Users/Desktop/AnswerKey_Example.xml") :
incomplete final line found on '/Users/Desktop/AnswerKey_Example.xml'
>newqual <- CreateQualificationType(name="Classifier: Basic",
description="This qualification exam tests basic understanding of speech",
status="Active",
test.duration=seconds(hours=1),
test=QuestionForm,
answerkey=AnswerKey,
validate.test=TRUE,
validate.answerkey=TRUE,
sandbox=sandbox.v)
Error in CreateQualificationType(name = "Classifier: Basic", description = "This qualification exam tests basic understanding of speech", :
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
请帮忙。
【问题讨论】:
-
您是否准确复制了示例?我无法准确地复制它。您能否更新您的问题以包含
sessionInfo()的输出? -
感谢您编辑链接@Thomas。我已经用有关我在尝试运行此示例时遇到的错误的更新信息修改了问题。
-
QuestionForm_Example.xmlvalidates 但缺少 DOCTYPE 和字符编码。是这个问题吗? -
首先更新您的 MTurkR 安装。您比当前版本落后了几个版本。再试一次。如果不这样做,我怀疑这可能是特定于平台的问题。我已经opened a ticket 进一步调查此事。
-
谢谢...这是 R 版本的问题,我没有运行 Xquartz。我已更新我的答案以反映我所做的更改并表明它现在正在工作。
标签: r mechanicalturk