I have exported data from a result grid in SQL Server Management Studio to a csv file. The csv file looks correct.
But when I read the data into an R dataframe using read.csv, the first column name is prepended with "ï..". How do I get rid of this junk text?
Example:
str(trainData)
'data.frame': 64169 obs. of 20 variables:
$ ï..Column1 : int 3232...
$ Column2 : int 4242...
The data looks something like this (nothing special) :
Column1,Column2
100116577,100116577
100116698,100116702
..
usually come from spaces being replaced by.
's. Is thei
a part of the csv? I have only ever seenX
being added to colnames when they start with a number. – Lotsonnames(trainData)[1] <- gsub("[^A-Za-z0-9]", "", names(trainData)[1])
– Jostle