How to add / add data.frame abc file to a text file that I opened earlier. I write some important information to this file, and then I want to add this data.frame below this information. I get an error when trying to write data.frame abc using cat.
fileConn<-file("metadata.txt","w+") smoke <- matrix(c(51,43,22,92,28,21,68,22,9),ncol=3,byrow=TRUE) smoke <- as.data.frame(smoke) table <- sapply (smoke, class) abc <- data.frame(nm = names(smoke), cl = sapply(unname(smoke), class)) cat("some imp info","\n", file=fileConn) cat(abc,"\n", file=fileConn) close(fileConn) class(abc)
source share