Skip to content
Prev 391155 / 398506 Next

Where is list.names?

I am trying to redefine the default behavior of base::table by editing 
.Rprofile in my home directory:

table <- function(...,
                   useNA = "ifany",
                   exclude = if (useNA == "no") c(NA, NaN),
                   dnn = list.names(...),
                   deparse.level = 1){
     base::table(...,
                 useNA = useNA,
                 exclude = exclude,
                 dnn = dnn,
                 deparse.level = deparse.level)
}

Trying it, I get

 > table(c(1,1,2,NA))
Error in list.names(...) : could not find function "list.names"

However, by removing the argument 'dnn', it apparently works. I am 
probably doing this in the wrong way, but how should it be done?
I can guess what 'list.names' is (from the documentation), but where and 
how is it defined?

Thanks, G?ran
(On R-4.1.3)