Since data.table includes the awesome fread function which supports sep2 for lists within cells I was completely shocked to find there is no way to write a data.table with lists in columns to a delimited text file.
I had to roll my own function to save my data.tables but its not very generic.
write.data.table <- function(x, file) {
fileConn <-file(file)
writeLines(c(paste(colnames(x),collapse="\t"),
x[,paste(id,parent,layer,start,end,sapply(x,function(o) paste(o,collapse=",")),sapply(y,function(o) paste(o,collapse=",")),sep="\t")]
), fileConn)
close(fileConn)
}
There has to be a better way.