0

Whenever I am 'reading' in any data into R, and I proceed to 'view' this, The first column header contains a symbol which is preventing me from further analysis. My first column title should say: ID

Can anyone identify what this is?

test20<-read.csv("test20.csv", header=TRUE, sep=",")

When I View, this is the output:

(please see image included)

enter image description here

Here is a snippet of my .csv file

enter image description here

Ronak Shah
  • 377,200
  • 20
  • 156
  • 213
Lynn
  • 4,292
  • 5
  • 21
  • 44
  • 1
    You can use `read.csv("test20.csv", header=TRUE, sep=",", check.names = FALSE)`. If there are any non-standard names in the column names the `check.names` which is `TRUE` by default will do a check and convert the spaces etc to `.` – akrun Jan 02 '20 at 20:34
  • Thank you, I am still getting a symbol. I will further research this. – Lynn Jan 02 '20 at 20:36
  • Can you. check the output in console instead of `View` – akrun Jan 02 '20 at 20:37
  • yes, it shows the same symbol. – Lynn Jan 02 '20 at 20:38
  • 3
    If looks like you have a UTF-8 CSV file with a BOM (byte order marker). Use the solution here: https://stackoverflow.com/questions/21624796/read-a-utf-8-text-file-with-bom – MrFlick Jan 02 '20 at 20:42
  • 1
    yes this worked! read.csv(" " ,fileEncoding = "UTF-8-BOM") thank you! – Lynn Jan 02 '20 at 20:46

0 Answers0