I have just discovered that R will allow me to use partial variable names to subset data frames, as long as they are uniquely defined. I find this dangerous and am wondering if there is a way (like an environment variable or something) to disable this behavior.
Here is what I mean:
myframe <- data.frame(othervar=1:3, myvar=4:6)
print(myframe$myv)
[1] 4 5 6
What I would like to happen is the same as for
print(myframe$wrong)
NULL
Any way to change this?
See Question&Answers more detail:os