[R] Simple... but...

Wacek Kusnierczyk Waclaw.Marcin.Kusnierczyk at idi.ntnu.no
Wed Jul 23 16:55:25 CEST 2008



john seers (IFR) wrote:
>  
>
>
>
> This is definitely the best way:
>
> c(lapply(1:length(x), function(i, x, y) c(x[i], y[i]), x, y),
> recursive=TRUE)
>
>
>   
you'd better test it yourself;  it simply won't do the job -- you get a
list of vectors, no?
(hint: replace the initial 'c' with 'unlist';  but it's still cumbersome
and inefficient.)

vQ



More information about the R-help mailing list