[R] Where is list.names?

Eric Berger er|cjberger @end|ng |rom gm@||@com
Wed Mar 30 11:49:26 CEST 2022


At the R console prompt do:
> table

It prints out the source of the table() function. The first thing there is
the definition of list.names()

HTH,
Eric




On Wed, Mar 30, 2022 at 12:27 PM Göran Broström <goran.brostrom using umu.se>
wrote:

> 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)
>
> ______________________________________________
> R-help using r-project.org mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>

	[[alternative HTML version deleted]]



More information about the R-help mailing list