In regard to my question Prof. Warren (Victoria University of Wellington, NZ) suggested the line: assign(paste("freq.list",i,sep="."),freq.list) instead of the lines: filename<-paste("freq.list", i, "txt", sep=".") write(freq.list, file=filename[[1]], sep="", append=FALSE)