假设我有一个文本文件,data.txt中,含有 A B C D
1 2 3 4
5 6 7 8
函数read.table使用,我得到: > d = read.table('data.txt')
> d
V1 V2 V3 V4
1 A B C D
2 1 2 3 4
3 5 6 7 8
如何我是否这样做,而不是V1 V2 V3 V4出现,我得到文本文件中的列名?换句话说
我用下面的代码加载一些数据。 movies <- read.table("movies.dat", header=FALSE, sep="\n")
大部分数据在被装载好,这样的: 58 58::Postman, The (Postino, Il) (1994)::Comedy|Drama|Romance
59 59::Confessional, The (Confessionnal, Le)