Re: [R] replace elements in a list

2010-04-30 Thread William Dunlap
> -Original Message- > From: r-help-boun...@r-project.org > [mailto:r-help-boun...@r-project.org] On Behalf Of Wincent > Sent: Thursday, April 29, 2010 8:40 PM > To: r help > Subject: [R] replace elements in a list > > Dear all, I have a list like this: l &l

Re: [R] replace elements in a list

2010-04-29 Thread Wincent
Thanks. On 30 April 2010 12:14, Erik Iverson wrote: > Wincent wrote: >> >> Dear all, I have a list like this:  l <- list(list(a=1,b=NULL), >> list(a=2,b=2)) >> I want to find out the elements with value of NULL and replace them with >> NA. >> The actual case has a very long list, so manually find

Re: [R] replace elements in a list

2010-04-29 Thread Erik Iverson
Wincent wrote: Dear all, I have a list like this: l <- list(list(a=1,b=NULL), list(a=2,b=2)) I want to find out the elements with value of NULL and replace them with NA. The actual case has a very long list, so manually find out and replace them is not an option. I can use for loop to do this, b

[R] replace elements in a list

2010-04-29 Thread Wincent
Dear all, I have a list like this: l <- list(list(a=1,b=NULL), list(a=2,b=2)) I want to find out the elements with value of NULL and replace them with NA. The actual case has a very long list, so manually find out and replace them is not an option. I can use for loop to do this, but I want to know