write.table(),是保存数据为文件的函数。
> xiaohuqingdan <- c(3900088702, 3900072499,3900021029)
> xiaohuqingdan
[1] 3900088702 3900072499 3900021029
> write.table(xiaohuqingdan,"1234.txt")
得到的1234.txt,打开是这个样子:
"x"
"1" 3900088702
"2" 3900072499
"3" 3900021029
"x"是列名,"1","2","3"是行名。不输出列名、行名和代表字符串的双引号——加参数:quote = FALSE,row.names = FALSE, col.names = FALSE。
> write.table(xiaohuqingdan,"4321.txt",quote = FALSE,row.names = FALSE,
col.names = FALSE)
再次得到的4321.txt,打开来就成了这样:
3900088702
3900072499
3900021029