Hi
> -Original Message-
> From: r-help-boun...@r-project.org [mailto:r-help-bounces@r-
> project.org] On Behalf Of penguins
> Sent: Monday, August 20, 2012 1:15 PM
> To: r-help@r-project.org
> Subject: Re: [R] Remove several numbers from a sequence
>
> Hi!
>
&
many thanks for lots of different solutions. I have a couple of very large
data frames but using the unique identifier for each row and Arun's solution
zz[is.na(match(zz$z1,xx$x1)),]
has worked perfectly,
Thanks!
--
View this message in context:
http://r.789695.n4.nabble.com/Remove-severa
Hi!
Both yy[!(yy %in% xx)] and yy[is.na(match(yy,xx))] work a treat!
Developing this topic can anyone tell me how to extract rows which are not
replicated across 2 data frames. For example:
z1<-c(1,2,3,4)
z2<-c(5,6,7,8)
zz<- data.frame(cbind(z1,z2))
x1<-c(3,4)
x2<-c(7,8)
xx<- data.frame(cbind(x
yy[!yy%in%xx]
Clint BowmanINTERNET: cl...@ecy.wa.gov
Air Quality Modeler INTERNET: cl...@math.utah.edu
Department of Ecology VOICE: (360) 407-6815
PO Box 47600FAX:(360) 407-7534
Olympia, WA 98504-7600
On 17-08-2012, at 18:18, penguins wrote:
> Can anyone tell me how to remove several numbers for a sequence. For example:
>
> xx<- c(1,5,7,10)
> yy<-seq(1,10,1)
>
> how do I get take xx away from yy to get the new sequence
>
> 2,3,4,6,8,9
>
You can also do this
yy[!(yy %in% xx)]
Berend
___
HI,
Try this:
yy[is.na(match(yy,xx))]
#[1] 2 3 4 6 8 9
A.K.
- Original Message -
From: penguins
To: r-help@r-project.org
Cc:
Sent: Friday, August 17, 2012 12:18 PM
Subject: [R] Remove several numbers from a sequence
Can anyone tell me how to remove several numbers for a sequence
Take a look at ?setdiff
Michael
On Aug 17, 2012, at 12:18 PM, penguins wrote:
> Can anyone tell me how to remove several numbers for a sequence. For example:
>
> xx<- c(1,5,7,10)
> yy<-seq(1,10,1)
>
> how do I get take xx away from yy to get the new sequence
>
> 2,3,4,6,8,9
>
> Many thanks
Can anyone tell me how to remove several numbers for a sequence. For example:
xx<- c(1,5,7,10)
yy<-seq(1,10,1)
how do I get take xx away from yy to get the new sequence
2,3,4,6,8,9
Many thanks in advance
--
View this message in context:
http://r.789695.n4.nabble.com/Remove-several-numbers-
8 matches
Mail list logo