Reputation: 13
Suppose I have a text file, data.txt, containing
A B C D
1 2 3 4
5 6 7 8
Using read.table, I get:
> 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
How do I make it so that instead of V1 V2 V3 V4
appearing, I get the column names that are in the text file? In other words, I would like to have this:
> d
A B C D
1 1 2 3 4
2 5 6 7 8
Upvotes: 0
Views: 2511