Java Mailing List Archive

http://www.r-help.com/

Home » Home (12/2007) » R Help for Statistical Computing »

Re: [R] do.call("+", ...)

Robin Hankin

2006-11-20

Replies:


On 17 Nov 2006, at 15:09, Peter Dalgaard wrote:

[discussion of ..1 vs list(...)[[1]] snipped]


>
> Try
>
> g <- function(...) list(...)[[1]]
> h <- function(...) ..1
>
> g((print("Hey")), (print("Joe")))
> h((print("Hey")), (print("Joe")))
>
> and you should become enlightened. Bonus points for figuring out why I
> parenthesized the arguments.
>
>


I see the difference between g() and h(), but
AFAICS the parentheses make no difference:



> jj <- g((print("Hey")), (print("Joe"))) ; jj
[1] "Hey"
[1] "Joe"
[1] "Hey"
>
> jj <- g(print("Hey"), print("Joe")) ; jj
[1] "Hey"
[1] "Joe"
[1] "Hey"
>
>
> jj <- h((print("Hey")), (print("Joe"))) ; jj
[1] "Hey"
[1] "Hey"
>
> jj <- h(print("Hey"), print("Joe")) ; jj
[1] "Hey"
[1] "Hey"
>




--
Robin Hankin
Uncertainty Analyst
National Oceanography Centre, Southampton
European Way, Southampton SO14 3ZH, UK
tel 023-8059-7743

______________________________________________
R-help@(protected)
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.
©2008 r-help.com - Jax Systems, LLC, U.S.A.