Re: [R] compare 2 vectors

From: Antonio, Fabio Di Narzo <antonio.fabio_at_gmail.com>
Date: Thu, 28 Jun 2007 12:14:31 +0200

setdiff(b, a)

2007/6/28, Joćo Fadista <Joao.Fadista_at_agrsci.dk>:
> Dear all,
>
> I would like to take out the values from one vector that are equal to the values in another vector.
>
> Example:
> a <- c(1,2,3,4,5,6,7,8,9)
> b <- c(3,10,20,5,6)
> b_noRepeats = c(10,20)
>
> So I would like to have the vector b without the same values as vector a.
>
>
> Kind regards,
> Joćo Fadista
>
>
>
>
>
> [[alternative HTML version deleted]]
>
>
> ______________________________________________
> R-help_at_stat.math.ethz.ch 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.
>
>

-- 
Antonio, Fabio Di Narzo
Ph.D. student at
Department of Statistical Sciences
University of Bologna, Italy

______________________________________________
R-help_at_stat.math.ethz.ch 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 Thu 28 Jun 2007 - 11:01:54 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 Thu 28 Jun 2007 - 11:32:39 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.