[R] Finding a single unique item in duplicated vectors
jrkrideau at yahoo.ca
Wed Apr 4 19:15:35 CEST 2007
--- John Kane <jrkrideau at yahoo.ca> wrote:
> I have a very simple problem and am completely
> the solution.
> I have two character variables (character ID's from
> two datasets) Data set 'b'
> is data set 'a' with one more subject added.
> How do I find out which is the added subject?
> I have tried duplicated and unique without much
> success. I can find all the
> duplicated ID's but how do I extract the new
Amended examaple ( I forgot I had Hmic loaded and was
a <- as.character(c("b","d","c","a"))
b <- as.character( Cs("a","b,"c","d","e"))
h <- c(a,b) ; h
> I just want to extract that "e"!
> I had thought that
> might work but it simply returns all the unique
> I simply want to simply find the odd man out.
> I thought of using sorting the vectors & using a
> but the id's are assigned
> more or less randomly so that didn't work.
> R-help at stat.math.ethz.ch mailing list
> PLEASE do read the posting guide
> and provide commented, minimal, self-contained,
> reproducible code.
More information about the R-help