elp@r-project.org
> Subject: Re: [R] logical operations with lists
>
> I'm sorry but here's what I get:
>
> > A[1:10,]
> [1] UQCRC1 IDH3B PDHA1 SUCLA2 COX5B SDHB SDHA MDH2 DLD
> COQ7
>
> > dim(A)
> [1] 10131
>
> > B[1:1
"
c<-setdiff(b,a)# all those in B but not A
> c
[1] "d" "e"
cheers
iain
--- On Fri, 12/2/10, Zoppoli, Gabriele (NIH/NCI) [G]
wrote:
> From: Zoppoli, Gabriele (NIH/NCI) [G]
> Subject: Re: [R] logical operations with lists
> To: "r-help@r-project.org&
, LMP, NCI, NIH, Bethesda MD
Work: 301-451-8575
Mobile: 301-204-5642
Email: zoppo...@mail.nih.gov
From: jbreic...@gmail.com [jbreic...@gmail.com] On Behalf Of Jonathan
[jonsle...@gmail.com]
Sent: Friday, February 12, 2010 5:21 PM
To: Zoppoli, Gabriele (NI
NCI) [G]
> Subject: [R] logical operations with lists
> To: "r-help@r-project.org"
> Date: Friday, 12 February, 2010, 22:06
> Sorry, maybe it's easy but I haven't
> found anything useful:
>
> how can I obtain a list C that contains all the members in
&g
This is probably not the best way, but (assuming you had vectors and
not lists, since I'm not sure what your list looks like):
C <- B[which(B %in% A ==FALSE)]
Regards,
Jonathan
On Fri, Feb 12, 2010 at 5:06 PM, Zoppoli, Gabriele (NIH/NCI) [G]
wrote:
> Sorry, maybe it's easy but I haven't found
> a<-list('a', 'b', 'c')
> b<-list('c', 'd', 'e')
> c<-intersect(a,b)
> c
[[1]]
[1] "c"
Is this what you want?
Cheers
Iain
--- On Fri, 12/2/10, Zoppoli, Gabriele (NIH/NCI) [G]
wrote:
> From:
On Feb 12, 2010, at 5:06 PM, Zoppoli, Gabriele (NIH/NCI) [G] wrote:
Sorry, maybe it's easy but I haven't found anything useful:
how can I obtain a list C that contains all the members in the list
B that are not in list A? This are lists of nanes, not numbers!
> A <- list("a", "b" , "c")
>
Sorry, maybe it's easy but I haven't found anything useful:
how can I obtain a list C that contains all the members in the list B that are
not in list A? This are lists of nanes, not numbers!
Thank you
Gabriele Zoppoli, MD
Ph.D. Fellow, Experimental and Clinical Oncology and Hematology, Univer
8 matches
Mail list logo