zTreeTables function

Read '.xls' files generated by 'z-Tree' into R

Read '.xls' files generated by 'z-Tree' into R

Read '.xls' files which are written by the Microsoft Windows program 'z-Tree'. The latter is a software for developing and carrying out economic experiments (see http://www.ztree.uzh.ch/ for more information).

zTreeTables(files, tables = c("globals", "subjects"), sep = "\t", zTree.silent=getOption("zTree.silent"), zTree.encoding=getOption("zTree.encoding"),ignore.errors=FALSE)

Arguments

  • files: a vector of 'z-Tree' (xls-) filenames.
  • tables: a vector of table names. If you leave this empty, globals and subjects will be read. If you set tables=NULL, all tables will be read.
  • sep: Field separator. 'z-Tree' uses "\t" as a separator. If you have a manipulated file, you might need to change the separator.
  • zTree.silent: If TRUE, generates less verbose output.
  • zTree.encoding: zTree writes text files and seems to use latin1 (windows-1252) encoding for these files.
  • ignore.errors: Usually, zTreeTables stops with an error when it detects a wrong encoding or a manipulated file. With ignore.errors=TRUE it only generates a warning.

Returns

A list of all tables (e.g. "globals", "subjects", etc.)

References

Urs Fischbacher. "z-Tree: Zurich Toolbox for Ready-made Economic Experiments." Experimental Economics (2) 171-178, 2007.

Author(s)

Oliver Kirchkamp

See Also

See also zTreeSbj

Examples

## Not run: zTT <- zTreeTables(c("080712_1412.xls","080712_1818.xls")) with(zTT$subjects, table(Treatment,Period)) To read all tables from all sessions in directories below the current one: sessions<-list.files(".","[0-9]{6}_[0-9]{4}.xls",recursive=TRUE) zTT<-zTreeTables(sessions,tables=NULL) ## End(Not run)
  • Maintainer: Oliver Kirchkamp
  • License: GPL-3 | file LICENSE
  • Last published: 2021-11-03

Useful links