【发布时间】:2015-03-06 14:31:13
【问题描述】:
我会读取一个文本文件(使用 read.table),其中包含三列中的一列,其中包含诸如“000000”之类的字符,但我得到的是 0。我尝试:
X<-read.table(ouvrefic, header=TRUE, row.names=1, sep="",colClasses=c("integer","character","factor"))
我得到:
Error in scan(file, what, nmax, sep, dec, quote, skip, nlines, na.strings, :
scan() expected 'an integer', got '"1"' (problem comes from row.names, I suppose)
我该怎么做?
非常感谢。
我的文本文件的开头:
"" "dates" "Atscan2" "pqrPQR"
"1" "18369" "0000000000000" "1110"
"2" "18369" "0000000000000" "1220,0"
"3" "18369" "0000000000000" "2220"
"4" "18369" "0000000000000" "1230,0,0"
"5" "18369" "0000000000000" "1330,0"
"6" "18369" "0000000000000" "2330,0"
"7" "18369" "0000000000000" "3330"
【问题讨论】:
-
你能给我们看一下文件的一部分吗(前几行)?
-
"" "日期" "Atscan2" "pqrPQR" "1" "18369" "0000000000000" "1110" "2" "18369" "0000000000000" "1220,0" "3" "18369 ""0000000000000""2220""4""18369""0000000000000""1230,0,0""5""18369""0000000000000""1330,0""6""18369""0000000000000""2330,0 ""7""18369""0000000000000""3330"
-
请将其编辑到您的问题中,以便我们可以正确查看格式。
-
@Lio 这个链接可能会有所帮助r.789695.n4.nabble.com/…
标签: r read.table