ReadAqdtab <- function(aqdprj="frageboC",debug=1)# dn = Anzahl Dateien { # Lesen von AQUAD Codefiles und erstellen einer Matrix über alle Dateien # keine Aufteilung nach Sprechercode # Dateien sind numeriert mit Endung ".aco" (AQUAD konform) # Beispielfile = "person 1.aco" # acoV-Dateiname = c("/$person 109 1 ") # (C) Leo Gürtler 14-03-04 Tübingen (GER) source("ContAna.090304.R") # Oldenbürger für Löschen nehmen aqdindx <- as.character(readLines(paste(aqdprj,".inx",sep=""))) # Datei mit zu zählenden Codes indl <- length(aqdindx) # Zahl+".txt" abschneiden für Reihenfolge 1:Ende später # dirty hack !!: nam <- TrimR(as.character(readLines(paste(aqdprj,".nam",sep=""))),muell=c("t","x",".",0:10," ")) dn <- length(nam) codmat <- matrix(data=0, nrow=dn, ncol=indl) for(r in 1:dn) #dn # alle Dateien des Projektes = rows { acoV <- TrimR(as.character(substr(readLines(paste(nam[dn]," ",r,".aco",sep="")),21,50)),muell=c(" ")) # Kolumnen 17-50 lesen for(c in 1:indl) # alle Codes des Indizes = columns / zu zählende Codes { for(d in 1:length(acoV)) if(aqdindx[c] == acoV[d]) codmat[r,c] <- codmat[r,c] + 1 # alle Einträge in .aco Dateien if(debug == 1) print(paste("acoV: ",acoV," r: ",r," c: ",c," Matrixwert: ",codmat[r,c],sep="")) } } write.table(codmat,file=paste(aqdprj,"_cc.csv"),sep=",") # counted codes colnames(codmat) <- aqdindx # Kolumnenheaders mit Hyposbezeichnung füllen res <- list() res$aqdindx <- aqdindx res$nam <- nam res$codmat <- codmat res$call <- match.call() class(res) <- "aquad tab" return(res) }