Ivo,
That's standard R behaviour. But I've had similar bugs as you. If you really want to change it then one way would be to create your own helper function, say strictselect(), or shorter name and ensure to use that instead of [[ and $. Or, how about something like this? :
DF = data.frame(a=1:3,b=4:6) DF$foo
NULL
DF[["foo"]]
NULL
"$.data.frame" = "[[.data.frame" = function(x,...) {
if (!..1 %in% names(x)) stop("Column not found!") else base::"[[.data.frame"(x,...) }
DF$foo
Error in `$.data.frame`(DF, foo) : Column not found!
DF[["foo"]]
Error in `[[.data.frame`(DF, "foo") : Column not found!
DF[["newcol"]] <- 7:9 DF
a b newcol 1 1 4 7 2 2 5 8 3 3 6 9 Masking those methods in your .GlobalEnv shouldn't break packages that may rely on missing columns returning NULL because all packages now have namespaces. So this mask should just affect your own code, iiuc. You could place those masks into your Rprofile.site. It was quickly typed and tested, and not thoroughly thought through, so *it is just a straw man*. Matthew ______________________________________________ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel