Re: [R] mapping array

2010-09-12 Thread Gregory Ryslik
Worked great, thanks! On Sep 11, 2010, at 8:26 PM, wrote: > Is this the kind of thing you are talking about? > > ### 8< cut here 8< ### > A <- rep(NA, 100) > B <- sort(runif(25)) > C <- sort(sample(1:100, 25)) > > A[C] <- B > B > C > A > ### 8< cut here 8< ### > > > (The sorting is not nec

Re: [R] mapping array

2010-09-11 Thread Bill.Venables
Is this the kind of thing you are talking about? ### 8< cut here 8< ### A <- rep(NA, 100) B <- sort(runif(25)) C <- sort(sample(1:100, 25)) A[C] <- B B C A ### 8< cut here 8< ### (The sorting is not necessary. It's only there to make checking what happened easier.) -Original Message---

Re: [R] mapping array

2010-09-11 Thread Joshua Wiley
Hi Greg, I am sketchy on a few details of C, but does something like this work for you? I just created C1 (renamed because C() is a function) with two columns the first corresponding to A and the second to B. Then I just used the first column to select elements of A and the second to select elem