Is there a reason why R won't allow me to have a number as the column name of my dataframe?
Also noticed that if i do data.frame(XX)
it adds an X
to all the column headers that have numbers at the front.
Is there a reason why R won't allow me to have a number as the column name of my dataframe?
Also noticed that if i do data.frame(XX)
it adds an X
to all the column headers that have numbers at the front.
Works for me
Yes, because R won't allow names of objects to start with numbers. If you were to call
attach()
with the data.frame, this would cause some issues.data.frame
(andread.table
) function has thecheck.names
parameter (default isTRUE
)From
?make.names
: