2016-08-15 63 views
0

我想zTree的對象的數據文件(問卷調)導入到R和我使用zTreeSbj function written by Oliver Kirchkamp閱讀zTee主題文件

files <- list.files(pattern = "*.sbj$",recursive=TRUE) 
fname <- sub(".*/","",files) 
sbj <- zTreeSbj(aggregate(files,list(fname),function(x) x[1])$x) 

我收到以下錯誤:

reading 1 ... 
Error in file(filename, "r", encoding = getOption("zTree.encoding")) : 
invalid 'description' argument 
Called from: file(filename, "r", encoding = getOption("zTree.encoding"))  

回答

1

我同樣的問題,和奧利弗Kirchkamp回答我:

In your case you do not need aggregate. Simply say:

files <- list.files(pattern = "*.sbj$",recursive=TRUE) 
sbj <- zTreeSbj(files) 

這工作對我來說,因爲我沒有MULT相同的.sbj文件的iple版本。