s-news
[Top] [All Lists]

Re: [s] Indexing with List Number 2

To: "'Steve Su'" <s.su@qut.edu.au>, <s-news@lists.biostat.wustl.edu>
Subject: Re: [s] Indexing with List Number 2
From: "Steve Su" <s.su@qut.edu.au>
Date: Fri, 25 Oct 2002 16:16:13 +1000
Importance: High
In-reply-to: <000001c27bec$30f8df70$4f32b583@busacc325>

Dear All,

 

I have just worked out how to do it J

 

l<- list(NULL,1:2,3:5)

l[!unlist(lapply(l, is.null))]

 

Sorry about the trivial question!

 

Steve.

 

 

 

 

Dear All,

 

Thank you Nick Ellis for your assistance on my previous question.

 

I have a very short question this time consider this:

 

>list(NULL,1:2,3:5)

 

[[1]]:

NULL

 

[[2]]:

[1] 1 2

 

[[3]]:

[1] 3 4 5

 

Is there a command I can use to select the list that is not a NULL, I.e. select only [[2]] and [[3]]?

 

Thanks for your attention.

 

 

 

 

**************************************************************************************

 Steve Su (s.su@qut.edu.au)   
 PhD student. 

 
School of Accountancy
 School of Mathematical Sciences
 
Queensland University of Technology 

 Postal Address: Steve Su,
School of Accountancy, QUT, PO Box 2434, Brisbane,
 
Queensland, Australia, 4000.  


 Phone:  +61 7 3864 2017
 Fax:    +61 7 3864 1812     
 
Mobile: 0421  840  586 
     .                              
   _--_|\                 
  /      QUT                                  
  \_.--._/                                                                          
        v                                              
                                                                     
**************************************************************************************    

 

<Prev in Thread] Current Thread [Next in Thread>