Re: [R] Selecting elements in lists with a row condition

2014-02-04 Thread David Winsemius
On Feb 4, 2014, at 11:54 AM, Francesca Pancotto wrote: > Hello A. k. > thanks for the suggestion. > > I tried this but it does not work. I probably use it in the wrong way. > This is what it tells me, > > > do.call(rbind,lapply(bank.list,function(x) x[x[,"p_made"]==406,])) > > Errore in mat

Re: [R] Selecting elements in lists with a row condition

2014-02-04 Thread Jim Lemon
On 02/05/2014 06:54 AM, Francesca Pancotto wrote: Hello A. k. thanks for the suggestion. I tried this but it does not work. I probably use it in the wrong way. This is what it tells me, do.call(rbind,lapply(bank.list,function(x) x[x[,"p_made"]==406,])) Errore in match.names(clabs, names(xi)

Re: [R] Selecting elements in lists with a row condition

2014-02-04 Thread arun
Hi, Looks like the colnames of list elements are not the same. For e.g. lst1 <- list(structure(list(bankname = structure(c(1L, 1L, 1L, 1L, 1L, 1L), .Label = "CIB", class = "factor"), date = structure(c(1L, 2L, 3L, 1L, 2L, 3L), .Label = c("10/02/06", "10/23/06", "11/22/06" ), class = "factor"), px

Re: [R] Selecting elements in lists with a row condition

2014-02-04 Thread Francesca Pancotto
Hello A. k. thanks for the suggestion. I tried this but it does not work. I probably use it in the wrong way. This is what it tells me, do.call(rbind,lapply(bank.list,function(x) x[x[,"p_made"]==406,])) Errore in match.names(clabs, names(xi)) : names do not match previous names What am I

Re: [R] Selecting elements in lists with a row condition

2014-02-04 Thread arun
Hi, Try: If `lst1` is the list: do.call(rbind,lapply(lst1,function(x) x[x[,"p_made"]==406,])) A.K. On Tuesday, February 4, 2014 8:53 AM, Francesca wrote: Dear Contributors sorry but the message was sent involuntary. I am asking some advice on how to solve the following problem. I have a list

Re: [R] Selecting elements in lists with a row condition

2014-02-04 Thread Francesca
Dear Contributors sorry but the message was sent involuntary. I am asking some advice on how to solve the following problem. I have a list composed of 78 elements, each of which is a matrix of factors and numbers, similar to the following bank_name date px_last_CIB Q.Yp_made p_for 1

[R] Selecting elements in lists with a row condition

2014-02-04 Thread Francesca
Dear Contributors I am asking some advice on how to solve the following problem. I have a list composed of 78 elements, each of which is a matrix of factors and numbers, similar to the following bank_name date px_last_CIB Q.Yp_made p_for 1 CIB 10/02/061.33 p406-q40640