Andrew,
Is this what you seek?
all.addresses <- Reduce( union, dat[-1] )
who.is.here <- sapply( all.addresses,
function(x) dat$id[ rowSums(dat[ -1 ] == x ) != 0 ],
simplify=FALSE)
If not, try to give us more detail.
HTH,
Chuck
On Mon, 15 Dec 2008, Andrew C. Ward w
I think you mean duplicated *rows*, not columns, despite your subject
line.
See ?dublicated, which has a data.frame method.
On Mon, 15 Dec 2008, Andrew C. Ward wrote:
Dear list,
I have a data frame of survey respondents, a little like this:
set.seed(20081215)
n <- 100
dat <- data.frame(id=1
Dear list,
I have a data frame of survey respondents, a little like this:
set.seed(20081215)
n <- 100
dat <- data.frame(id=1:100,
addr1=sample(LETTERS, n, replace=TRUE),
addr2=sample(LETTERS, n, replace=TRUE),
addr3=sample(LETTERS, n, replace
3 matches
Mail list logo