Re: [R] Filling empty List in a FOR LOOP

2012-04-04 Thread MacQueen, Don
Try A[[1]] <- NA (It is of course up to you to do the tests, presumably using if(), to decide when to assign NA to the list element.) -Don -- Don MacQueen Lawrence Livermore National Laboratory 7000 East Ave., L-627 Livermore, CA 94550 925-423-1062 On 3/31/12 7:53 PM, "michaelyb" wrot

Re: [R] Filling empty List in a FOR LOOP

2012-04-01 Thread Rui Barradas
Hello, michaelyb wrote > > Ok. I appreciate your help. i don't understand what you guys mean by > "reproducible example", if you explained better, I will be more than glad > to post it. > > Regards, > Try this: R> A <- list(a=NULL, b=NULL) R> A R> dput(A) Now, the output of 'dput' is a rep

Re: [R] Filling empty List in a FOR LOOP

2012-04-01 Thread michaelyb
Ok. I appreciate your help. i don't understand what you guys mean by "reproducible example", if you explained better, I will be more than glad to post it. Regards, -- View this message in context: http://r.789695.n4.nabble.com/Filling-empty-List-in-a-FOR-LOOP-tp4522694p4524532.html Sent from th

Re: [R] Filling empty List in a FOR LOOP

2012-04-01 Thread ilai
On Sun, Apr 1, 2012 at 9:59 AM, michaelyb wrote: > Basically I need to read the data from an external source using many R > commands. > The problem is that sometimes the source is empty, and I get a list with > empty values, and I need to substitute them by "NA". > It is def. not hard, I just don'

Re: [R] Filling empty List in a FOR LOOP

2012-04-01 Thread michaelyb
Basically I need to read the data from an external source using many R commands. The problem is that sometimes the source is empty, and I get a list with empty values, and I need to substitute them by "NA". It is def. not hard, I just don't see how In the prvious post, the first example had val

[R] Filling empty List in a FOR LOOP

2012-03-31 Thread michaelyb
Hello all, I am trying to automate a list to be filled in a FOR LOOP. Basically I need to load info from a third source and store it into a list. This list goes to object "A"; The next list brought in by the LOOP goe to object "B".. os on ans so forth. When the iteration on the LOOP goes well (wh