Re: [R] Initialize many variables to NUL, check whether an object exist

2008-04-14 Thread Gabor Csardi
What is RG? I suspect it is not a list but a vector and you operation you wrote does not make sense. Convert it to a list if you want to store c("a","b") is RG[["AB"]]. G. On Tue, Apr 15, 2008 at 12:06:14AM +0800, Ng Stanley wrote: > Hi, > > How can I force the assignment ? > > > RG[["ABC"]]

Re: [R] Initialize many variables to NUL, check whether an object exist

2008-04-14 Thread Ng Stanley
Hi, How can I force the assignment ? > RG[["ABC"]] <- c("a", "b") Error in RG[["ABC"]] <- c("a", "b") : more elements supplied than there are to replace On Mon, Apr 14, 2008 at 9:53 PM, Gabor Csardi <[EMAIL PROTECTED]> wrote: > On Mon, Apr 14, 2008 at 09:47:49PM +0800, Ng Stanley wrote: > >

Re: [R] Initialize many variables to NUL, check whether an object exist

2008-04-14 Thread Gabor Csardi
On Mon, Apr 14, 2008 at 09:47:49PM +0800, Ng Stanley wrote: > Hi, > > Two questions: > > A) I need to initialize many variables to NULL. So I created variable_names > <- c("a1", "a2"). What can I do to variable_names so that variable a1 is > NULL and a2 is NULL ? for (n in variable_names) assign

[R] Initialize many variables to NUL, check whether an object exist

2008-04-14 Thread Ng Stanley
Hi, Two questions: A) I need to initialize many variables to NULL. So I created variable_names <- c("a1", "a2"). What can I do to variable_names so that variable a1 is NULL and a2 is NULL ? B) How can I check whether an object exist ? Thanks Stanley [[alternative HTML version deleted]]