在R中读取zTee主题文件 [英] reading zTee subject files in R

查看:233
本文介绍了在R中读取zTee主题文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想将zTree主题数据文件(quetionaire)导入R,我正在使用 zTreeSbj函数编写作者:Oliver Kirchkamp

I want to import zTree subjects data files (quetionaire) to R and I am using zTreeSbj function written by Oliver Kirchkamp:

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"))    


推荐答案

我遇到了同样的问题,Oliver Kirchkamp回复了我:

I had the same problem, and Oliver Kirchkamp replied to me:


在您的情况下,您不需要汇总。简单地说:

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

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


我,因为我没有相同的.sbj文件的多个版本。

That worked for me, because I did not have multiple versions of the same .sbj file.

这篇关于在R中读取zTee主题文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆