From m@rk@v@nderloo @ending from gm@il@com  Thu May  3 16:52:19 2018
From: m@rk@v@nderloo @ending from gm@il@com (Mark van der Loo)
Date: Thu, 03 May 2018 14:52:19 +0000
Subject: [Rd] length of `...`
In-Reply-To: <d0b68216-4922-2249-e5e6-1589345dc6d7@kogentum.hu>
References: <d0b68216-4922-2249-e5e6-1589345dc6d7@kogentum.hu>
Message-ID: <CAOKDuOjM0HZ+-e++P7J951DpWk4yn1uPO+e+j_N-xLHJmL_Oaw@mail.gmail.com>

This question is better aimed at the r-help mailinglist as it is not about
developing R itself.


having said that,

I can only gues why you want to do this, but why not do something like this:


f <- function(...){
   L <- list(...)
   len <- length()
  # you can stll pass the ... as follows:
  do.call(someotherfunction, L)

}


-Mark

Op do 3 mei 2018 om 16:29 schreef D?nes T?th <toth.denes at kogentum.hu>:

> Hi,
>
>
> In some cases the number of arguments passed as ... must be determined
> inside a function, without evaluating the arguments themselves. I use
> the following construct:
>
> dotlength <- function(...) length(substitute(expression(...))) - 1L
>
> # Usage (returns 3):
> dotlength(1, 4, something = undefined)
>
> How can I define a method for length() which could be called directly on
> `...`? Or is it an intention to extend the base length() function to
> accept ellipses?
>
>
> Regards,
> Denes
>
> ______________________________________________
> R-devel at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel
>

	[[alternative HTML version deleted]]




[Rd] length of `...`
Mark van der Loo