R语言里read.table的问题

data=list.files()
data[1]=read.table("SH000004.txt",header=FALSE,sep=",")
显示“替换的项目不是替换值长度的倍数”,
请问是哪里有问题呢?

第1个回答  2015-12-03
就是你的SH000004.txt里面的值长度不是你要替换的文件里的长度倍数呀,你可以新建一个用write.table 再删掉原来的
第2个回答  2019-01-10
先用read.table读进来,再用names()来改,再write.table写出去。
x <- read.table("d:/sheet.txt", header = t)
names(x) <- c(...) # c(...) 是新的表头
write.table(x, file = "d:/newsheet.txt",...)
第3个回答  2015-07-23
model' => $model, // Your model
attribute' => 'news_date', // Attribute for input
options' => array(
dateFormat' => 'yy-mm-dd',
changeYear'=> 'true',
changeMonth'=> 'true',
yearRange'=> '1900:2099',
showOn' => 'both',
buttonText' => 'Click',
)
相似回答