0

I'm attempting to read a .txt file with tab-delimited values. The first row are column names followed by the data set. An example of a column name would be: "HSC 1998 M&E-G".

When R reads the .txt file with the command: Demo <- read.table(demo.txt, header=TRUE, sep="\t")

The result is a column headers that have lost their special characters ( ,&,-): "HSC.1998.M.E.G"

How do I retain the space/dash/ampersand in the column name when I read the text file?

MyopicVisage
  • 1,333
  • 1
  • 19
  • 33
  • 1
    See the argument `check.names`. Set it to `FALSE`. You'll see your special characters, but expect headaches later on. – A5C1D2H2I1M1N2O1R2T1 Oct 31 '13 at 19:07
  • There are [many](http://stackoverflow.com/q/11596785/1270695) [more](http://stackoverflow.com/q/17010108/1270695) [duplicates](http://stackoverflow.com/q/12294071/1270695) too. – A5C1D2H2I1M1N2O1R2T1 Oct 31 '13 at 19:20

0 Answers0