So when running my dataset, R studio change the way it wants me to refere to my data , in on of these two ways:
Baseline$Rec.age.in.y
Baseline$Rec age in y
This means that I often have to change my entire script.
Why does this happen?
I have installed the following packages
This is a non-syntactic variable name (because of the empty spaces) and should be avoided since It can cause issues and makes code typing harder. That is why packages like readxl automatically "clean" them (by replacing empty spaces with dots).
The way to force the use of a non-syntactic variable name is by enclosing it between backticks i. e. `Rec age in y`
Thank you for the fast reply.
I still don't know hwo I get it to accept Baseline$Rec.age.in.y
All my codes are written like this, but now after running library(readxl), it wants me to change it to Baseline$ Rec age in yand this messages comes up:
Error in unique.default(c("AsIs", oldClass(x))) :
object 'Rec.age.in.y' not found
Both variable names are not equivalent, you have to choose a naming convention and make sure your data set is being read respecting that naming convention.