After importing a file, I always try try to remove spaces from the column names to make referral to column names easier.
Is there a better way to do this other then
There is an easy way to remove spaces in column names in data.table. You will have to convert your data frame to data table.
setnames(x=DT, old=names(DT), new=gsub(" ","",names(DT)))
Country Code will be converted to CountryCode
Country Code
CountryCode