[R] Remove several numbers from a sequence

Clint Bowman clint at ecy.wa.gov
Fri Aug 17 18:46:41 CEST 2012


yy[!yy%in%xx]

Clint Bowman			INTERNET:	clint at ecy.wa.gov
Air Quality Modeler		INTERNET:	clint at math.utah.edu
Department of Ecology		VOICE:		(360) 407-6815
PO Box 47600			FAX:		(360) 407-7534
Olympia, WA 98504-7600

         USPS:           PO Box 47600, Olympia, WA 98504-7600
         Parcels:        300 Desmond Drive, Lacey, WA 98503-1274

On Fri, 17 Aug 2012, 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 in advance
>
>
>
> --
> View this message in context: http://r.789695.n4.nabble.com/Remove-several-numbers-from-a-sequence-tp4640630.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.
>




More information about the R-help mailing list