我想用讀取數據文件:作爲分隔符如何使用函數read.table文件與分隔符 t
ds <- read.table(file="/data/ken/tmp/tt", header=F,
sep="\t", quote="\"", dec=".",
fill=T, comment.char="",
stringsAsFactors=F,
colClass=rep("character", 6))
文件tt
看起來跟隨,與\t
20130129074502\thttp://xxx.com.cn/notebook/asus/526600_detail.html\t\t5025\t526600\t255dkmi
但它不起作用:
caution:
In read.table(file = fcon, header = F, sep = "\t", quote = "\"", :
cols = 1 != length(data) = 6
是否'\ t'代表2逐行讀取,並分字節字符串「\ t」或「tab」? – wush978 2013-02-18 06:25:08
爲什麼不使用'read.delim'來設置製表符分隔文件? – 2013-02-18 06:50:37
對於傻笑,試試'sep =「\\ t」'。 – 2013-02-18 08:19:15