[R] compare 2 vectors

Antonio, Fabio Di Narzo antonio.fabio at gmail.com
Thu Jun 28 12:14:31 CEST 2007


setdiff(b, a)

2007/6/28, João Fadista <Joao.Fadista a 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 a 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



More information about the R-help mailing list