I am trying to create a data.frame with column names specified. When I input the following:
df_ht <- data.frame("Teams" = NA, "Shots" = NA, "Shots On Target" = NA)
I get the following header:
Teams Shots Shots.On.Target
1 NA NA NA
Then I put spaces next to the names to try spacing out the actual column names:
df_ht <- data.frame(" Teams " = NA, " Shots " = NA, " Shots On Target " = NA)
And I got this:
X.Teams. X.Shots. X.Shots.On.Target.
1 NA NA NA
Why did the X
and the .
appear? How can I get rid of the .
?