Re: [R] Simple... but...

From: Wacek Kusnierczyk <Waclaw.Marcin.Kusnierczyk_at_idi.ntnu.no>
Date: Wed, 23 Jul 2008 16:55:25 +0200

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



R-help_at_r-project.org mailing list
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. Received on Wed 23 Jul 2008 - 16:04:04 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Wed 23 Jul 2008 - 16:32:10 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive