Message-ID: <bf4e8ac5-7b4a-ce86-c755-2a178b84de24@umu.se>
Date: 2022-03-30T12:39:52Z
From: Göran Broström
Subject: Where is list.names?
In-Reply-To: <20220330140112.48e016e0@arachnoid>
Den 2022-03-30 kl. 13:01, skrev Ivan Krylov:
> ? Wed, 30 Mar 2022 12:43:52 +0200
> G?ran Brostr?m <goran.brostrom at umu.se> ?????:
>
>> That works, if I check for missing argument
>
>> Is this the final word?
>
> How about omitting it entirely and letting ... handle it?
Looks nice, thank you!
>
> table <- function(
> ..., useNA = "ifany", exclude = if (useNA == "no") c(NA, NaN),
> deparse.level = 1
> ) base::table(
> ..., useNA = useNA, exclude = exclude, deparse.level = deparse.level
> )
> table(c(1,1,2,NA))
> #
> # 1 2 <NA>
> # 2 1 1
> table(c(1,1,2,NA), dnn = 'a')
> # a
> # 1 2 <NA>
> # 2 1 1
>
>