Re: [R] List help

From: Jorge Ivan Velez <jorgeivanvelez_at_gmail.com>
Date: Fri, 11 Jul 2008 16:31:53 -0400

Hi Ramya,

Perhaps

result[lapply(result, length) != 0]

does the work.

HTH, Jorge

On Fri, Jul 11, 2008 at 3:57 PM, Rajasekaramya <ramya.victory_at_gmail.com> wrote:

>
> hi,
>
> I need to remove the list that does not have any values.Do suggest me the
> way to do it.
>
> result<- list()
>
> > head(result)
>
> [[1]]
> [,1] [,2] [,3]
>
> [[2]]
> [,1] [,2] [,3]
>
> [[3]]
> [,1] [,2] [,3]
>
> [[4]]
> [,1] [,2] [,3]
>
> [[5]]
> [,1] [,2] [,3]
> [1,] "HIGD1C" "SNP_A-2058537" "4"
> [2,] "HIGD1C" "SNP_A-1955347" "4"
> [3,] "HIGD1C" "SNP_A-1947169" "3"
> [4,] "HIGD1C" "SNP_A-2088027" "1"
> [5,] "HIGD1C" "SNP_A-2070418" "1"
> [6,] "HIGD1C" "SNP_A-4253870" "1"
> [7,] "HIGD1C" "SNP_A-2185340" "1"
> [8,] "HIGD1C" "SNP_A-1794461" "1"
> [9,] "HIGD1C" "SNP_A-1928826" "1"
> [10,] "HIGD1C" "SNP_A-1938145" "1"
> [11,] "HIGD1C" "SNP_A-1889970" "1"
>
> [[6]]
> [,1] [,2] [,3]
>
>
> I have 386 list elements I need to remove these empty
> martix.([[1]],[[2]],[[3]],[[4]].[[6]])
>
> do help me
>
> Ramya
> --
> View this message in context:
> http://www.nabble.com/List-help-tp18411519p18411519.html
> Sent from the R help mailing list archive at Nabble.com.
>
> ______________________________________________
> R-help_at_r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>

        [[alternative HTML version deleted]]



R-help_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Received on Fri 11 Jul 2008 - 20:47:06 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Fri 11 Jul 2008 - 22:31:48 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive