Skip to content
Prev 30560 / 398513 Next

removing NULL elements from a list

Hello,

Have you tried:

lapply(your_list, na.omit)

Regards,
Carlos.



-----Mensaje original-----
De: r-help-bounces at stat.math.ethz.ch
[mailto:r-help-bounces at stat.math.ethz.ch]En nombre de Ramon Diaz
Enviado el: lunes, 14 de abril de 2003 16:10
Para: R-Help (E-mail)
Asunto: [R] removing NULL elements from a list


Dear All,

I have a list, where several components are NULL, and I'd like to obtain
that
very same list without the NULL components (i.e., I do not want to unlist or
otherwise loose the rest of the list structure). I can do that with a loop,
but how could I do it without a loop?

Thanks,

Ram?n

--
Ram?n D?az-Uriarte
Bioinformatics Unit
Centro Nacional de Investigaciones Oncol?gicas (CNIO)
(Spanish National Cancer Center)
Melchor Fern?ndez Almagro, 3
28029 Madrid (Spain)
Fax: +-34-91-224-6972
Phone: +-34-91-224-6900

http://bioinfo.cnio.es/~rdiaz

______________________________________________
R-help at stat.math.ethz.ch mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help

###  This email has been checked for all known viruses by the
###  Firstnet anti-virus system - http://www.firstnet.net.uk
###  Please email fav at firstnet.net.uk for details.


_____
The information in this email is confidential and it may not be\... {{dropped}}