小伙伴说他写个CSV文件,名字就变了,无缘无故|就被改了,还有些名字被强加了X。我注意到了他写的对象是data.frame(d),这锅绝对是data.frame的。

我们可以试一下:

> d = matrix(rnorm(4), ncol=2)
> colnames(d) = c("A|B", "123")
> write.csv(data.frame(d))
"","A.B","X123"
"1",-0.601247669017546,0.802654193340092
"2",-0.128752028398414,0.430829592244036

没错,自己给变了。

Continue reading

Author's picture

Guangchuang Yu

a senior-in-age-but-not-senior-in-knowledge bioinformatician

Postdoc researcher

Hong Kong