Reputation: 1
Code:
data <- read.csv("./data.csv",header=T)
data
Output:
X224786 X578 X871 X9719
1 230034 546 969 10262
2 236562 599 845 10120
Expected Output:
A B C D
224786 578 871 9719
230034 546 969 10262
236562 599 845 10120
Upvotes: 0
Views: 57
Reputation: 63
Obviously, your *.csv file has no header line. So, try:
data <- read.csv("./data.csv", header=F)
names(data) <- c("A","B","C","D")
Upvotes: 2
Reputation: 9696
Try read.table
instead of read.csv
. read.csv
requires commas between each field.
Upvotes: 0