Dear Ramya,
Try this:
# Your list
A=matrix(rnorm(100),ncol=10)
B=matrix(rnorm(100),ncol=10)
C=matrix(rnorm(100),ncol=10)
colnames(A)=colnames(B)=colnames(C)=paste('X',1:10,sep="")
mylist=list(A,B,C)
names(mylist)=c('A','B','C')
# Your name vector
x=c('A','C')
# Marching up!
mylist[names(mylist)
Try this:
A1 <- list(abc = letters[1:3], dce = letters[4:6], kpo = letters[7:8])
v <- c("abc", "dce")
A1[setdiff(names(A1), v)]
On Thu, Oct 9, 2008 at 4:01 PM, Rajasekaramya <[EMAIL PROTECTED]> wrote:
>
> Hi,
>
> I have a list(A1) of dataframe and a vector containing a 22 list names.
> list(A1)
>
could you make this reporducible- even with dummy data...? I am not sure
what you want.
On Thu, Oct 9, 2008 at 3:01 PM, Rajasekaramya <[EMAIL PROTECTED]>wrote:
>
> Hi,
>
> I have a list(A1) of dataframe and a vector containing a 22 list names.
> list(A1)
> abc
> l m n
> p q r
>
> dce
> e g h
Hi,
I have a list(A1) of dataframe and a vector containing a 22 list names.
list(A1)
abc
l m n
p q r
dce
e g h
l k m
kpo
a d c
also i have a vector of list names.
abc,dce similarly i have 22 elements.
I wanna delete or want a list without the list elements whoes name match up
the vector.
Hi Ramya,
Perhaps
result[lapply(result, length) != 0]
does the work.
HTH,
Jorge
On Fri, Jul 11, 2008 at 3:57 PM, Rajasekaramya <[EMAIL PROTECTED]>
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(res
Thank u so much it did work
Rajasekaramya 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]
>
Perhaps something about like this:
result[which(unlist(lapply(result, length)) != 0)]
On Fri, Jul 11, 2008 at 4:57 PM, Rajasekaramya <[EMAIL PROTECTED]> 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(resul
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
8 matches
Mail list logo