Add lines to a file

我的未来我决定 提交于 2019-11-27 21:00:39

Have you tried using the write function?

line="blah text blah blah etc etc"
write(line,file="myfile",append=TRUE)
Rainer

write.table, write.csv and others all have the append= argument, which appends append=TRUE and usually overwrites if append=FALSE. So which one you want to / have to use, depends on your data.

By the way, cat() can also be used to write text to a file and also has the append= argument.

Sailu Yellaboina
lapply(listOfVector, function(anyNameofVect){ write(anyNameofVect, file="outputFileName", sep="\t", append=TRUE, ncolumns=100000) })

or

lapply(listOfVector, write, file="outputFileName", sep="\t", append=TRUE, ncolumns=100000)
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!