Richard Rublev
Richard Rublev

Reputation: 8172

Unexpected symbol in read.table

I am trying to read data with:

data <- read.table('pwaves.txt', header=TRUE, row.names=1, sep='\t')

Works ok,except I got X in front of each number.Like this:

      X5   X6   X7
fcm 13.0 12.5 11.8
gk  10.9 10.5 10.2
gg  12.0 11.0 10.8

Why?

Upvotes: 1

Views: 3257

Answers (1)

Arcoutte
Arcoutte

Reputation: 830

Isn't it because your headers are numeric, R checks this and transforms it. Try to add check.names=FALSE

     data <- read.table('pwaves.txt', header=TRUE, row.names=1, check.names=FALSE, sep='\t')  

Upvotes: 1

Related Questions