Re: [R] apply one list to another one

2012-05-03 Thread Rui Barradas
Hello, Hui Du wrote > > Hi All, > > Suppose I have the following codes: > > x = data.frame(A = rnorm(20), B = rnorm(20), C = rnorm(20)) > a = list() > a[["1.1"]] = x > a[["1.2"]] = x > > b = list() > b[["1.1"]] = c("A", "B") > b[["1.2"]] = c("B", "C") > > > Now I want to apply b to a like t

Re: [R] apply one list to another one

2012-05-03 Thread David Winsemius
On May 3, 2012, at 7:39 PM, Hui Du wrote: Hi All, Suppose I have the following codes: x = data.frame(A = rnorm(20), B = rnorm(20), C = rnorm(20)) a = list() a[["1.1"]] = x a[["1.2"]] = x b = list() b[["1.1"]] = c("A", "B") b[["1.2"]] = c("B", "C") Now I want to apply b to a like this, for

[R] apply one list to another one

2012-05-03 Thread Hui Du
Hi All, Suppose I have the following codes: x = data.frame(A = rnorm(20), B = rnorm(20), C = rnorm(20)) a = list() a[["1.1"]] = x a[["1.2"]] = x b = list() b[["1.1"]] = c("A", "B") b[["1.2"]] = c("B", "C") Now I want to apply b to a like this, for each element of 'a', only select the corresp