I've noticed that R changes column names when those could be arguments. For example
foo.df <- data.frame("for" = rnorm(100,0,1), "else"=rnorm(100,2,0.1))
foo.cor.df <- cor(foo.df)
else are among the reserved words in R and using them as names in a data frame is not valid. See
?data.frame and the
check.names argument, which directs you to
?make.names, which has:
Details: A syntactically valid name consists of letters, numbers and the dot or underline characters and starts with a letter or the dot not followed by a number. Names such as ‘".2way"’ are not valid, and neither are the reserved words.
noting the last line.
. is added to make the names valid.