Great! Thanks for replying so quickly Grey. I've attached some example data and the R code.
I figure it's best to start at the beginning. The data began as just txt files. I've imported all the txt files, added the lineage to the data frame and stacked all the txt files. The final data frame I'm trying to get will have single averaged values for all factors while still keeping the categorical values. I was unsure of how to keep the inter-call and call data separate, so initially I just removed all inter-call data, but since you have experience with RavenPro you may have a better method?
Stacking Data frame####
list_of_files <- list.files(path = home, recursive = TRUE,
pattern = "\.txt$",
full.names = F)
DT <- rbindlist(sapply(list_of_files, fread, simplify = FALSE),
use.names = TRUE, idcol = "FileName", fill = TRUE)
binding data
data = merge(id, DT, by = 'FileName')
data1 = merge(id, DT, by = 'FileName')
Replacing N/A values in dataframe with NA
data1[data1 == "A"] <- "XXX"
data1[data1 == "N/A"] <- ""
data1[data1 == ""] <- NA
data1[data1 == ""] <- NA
data1
Removing all intercall data
toBeRemoved<-which(data1$Type=="intercall", data1$Type=="inercall")
data2<-data1[-toBeRemoved,]
Averaging the data and creating new dataframe
acoustic_summary = aggregate(data2, by=list(data2$FileName), FUN=mean, na.rm=TRUE)