Displaying 9 results from an estimated 9 matches for "dotlength".
Did you mean:
doclength
2018 May 04
1
length of `...`
The one difference I see, is the necessity to pass the dots to the function
dotlength :
dotlength <- function(...) nargs()
myfun <- function(..., someArg = 1){
n1 <- ...length()
n2 <- dotlength()
n3 <- dotlength(...)
return(c(n1, n2, n3))
}
myfun(stop("A"), stop("B"), someArg = stop("c"))
I don't really see immediately how...
2018 May 06
0
length of `...`
...nstead of
match.call()[-1L] .
-------------------------------------------
>>>>> Joris Meys <jorismeys at gmail.com>
>>>>> on Fri, 4 May 2018 15:37:27 +0200 writes:
> The one difference I see, is the necessity to pass the dots to the function
> dotlength :
> dotlength <- function(...) nargs()
> myfun <- function(..., someArg = 1){
> n1 <- ...length()
> n2 <- dotlength()
> n3 <- dotlength(...)
> return(c(n1, n2, n3))
> }
> myfun(stop("A"), stop("B"), someAr...
2018 May 03
7
length of `...`
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,
Dene...
2018 May 03
3
length of `...`
Hi,
It would be great if one of the experts could comment on the
difference between Hadley's dotlength and ...length? The fact
that someone bothered to implement a new primitive for that
when there seems to be a very simple and straightforward R-only
solution suggests that there might be some gotchas/pitfalls with
the R-only solution.
Thanks,
H.
On 05/03/2018 08:34 AM, Hadley Wickham wrote:
>...
2018 May 03
2
length of `...`
...?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 ba...
2018 May 04
0
length of `...`
>>>>> Herv? Pag?s <hpages at fredhutch.org>
>>>>> on Thu, 3 May 2018 08:55:20 -0700 writes:
> Hi,
> It would be great if one of the experts could comment on the
> difference between Hadley's dotlength and ...length? The fact
> that someone bothered to implement a new primitive for that
> when there seems to be a very simple and straightforward R-only
> solution suggests that there might be some gotchas/pitfalls with
> the R-only solution.
Namely
> dotlength <-...
2018 May 03
0
length of `...`
...-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
> a...
2018 May 03
0
length of `...`
...com
On Thu, May 3, 2018 at 7:29 AM, D?nes T?th <toth.denes at kogentum.hu> wrote:
> 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...
2018 May 03
4
length of `...`
On 03/05/2018 11:01 AM, William Dunlap via R-devel wrote:
> In R-3.5.0 you can use ...length():
> > f <- function(..., n) ...length()
> > f(stop("one"), stop("two"), stop("three"), n=7)
> [1] 3
>
> Prior to that substitute() is the way to go
> > g <- function(..., n) length(substitute(...()))
> >