you can combine write and write.table, using append=TRUE.
e.g.,
write1 <- function(txt, mat, filename) {
for(i in 1:length(txt)) {
write(txt[i], file=filename, append=i!=1)
write.table(mat[[i]], file=filename, append=TRUE,sep ="\t")
}
}
t <- c("text1", "text2", "text3")
m <- list(mat
Hi,
I want a function to write some of its output into a text file with
the following format:
'some text'
output matrix A
'some more text'
output matrix B
'some other text still'
output matrix C
...
The dimensions of matrices A, B, ... are different and the total
number of matrices
that I w
2 matches
Mail list logo