Please help me understand this rather weird data.frame behavior. When I use the <-
operator I get a different and unexpected column name:
x <- data.frame (y <- 1)
a <- data.frame (b = 1)
> colnames(x)
[1] "y....1"
> colnames(a)
[1] "b"
I know the difference between the operators:
> b
Error: object 'b' not found
> y
[1] 1
In this answer the behavior is mentioned. In the comments, data.frame calling make.names("y <- 1") is given as an explanation. I don't get this reasoning. Is is just a bug which should be removed in the future?