Re: [R] "not all duplicated" question

2013-07-13 Thread arun
e(x)>1,] #  Country  Pet #1  France  Dog #2  France  Cat #3  France  Dog #6   Japan  Dog #7   Japan  Cat A.K. - Original Message - From: Vesco Miloushev To: r-help@r-project.org Cc: Sent: Saturday, July 13, 2013 4:12 PM Subject: [R] "not all duplicated" question Hi,

Re: [R] "not all duplicated" question

2013-07-13 Thread jim holtman
try this: > x <- read.csv(text = "Country, Pet + France, Dog + France, Cat + France, Dog + Canada, Cat + Canada, Cat + Japan, Dog + Japan, Cat + Italy, Cat", as.is = TRUE) > # split by Country and then see if dups in "Pet" > xs <- split(x, x$Country) > Dups <- do.call(rbind + , lapply(xs,

[R] "not all duplicated" question

2013-07-13 Thread Vesco Miloushev
Hi, I want to select elements which have duplicates by are not all duplicated. Here is what I mean. Suppose I have a two column matrix with columns "Country" and "Pet" Country, Pet -- France, Dog France, Cat France, Dog Canada, Cat Canada, Cat Japan, Dog Japan, Cat Italy, Cat I