Re: [R] data comparison

2012-12-26 Thread arun
nction(x) length(setdiff(x,comp A.K. - Original Message - From: Yung Chih Ou To: r-help Cc: Sent: Wednesday, December 26, 2012 7:37 AM Subject: [R] data comparison Dear all: I have six vector from six DIF detection results. as below: > difMH[[100]]$DIFitems [1]  1  9 19

Re: [R] data comparison

2012-12-26 Thread Rui Barradas
Hello, Sorry, my previous post is wrong, to make of it a matrix use do.call(cbind, lapply(idx, function(i) difMH[[i]]$DIFitems)) Hope this helps, Rui Barradas Em 26-12-2012 14:44, Rui Barradas escreveu: Hello, Try the following. # 1. idx <- seq(50, 100, by = 10) mat <- matrix(difMH[idx]$DIF

Re: [R] data comparison

2012-12-26 Thread Rui Barradas
Hello, Try the following. # 1. idx <- seq(50, 100, by = 10) mat <- matrix(difMH[idx]$DIFitems, ncol = length(idx)) # 2. comp <- c(1, 9, 21, 22, 25, 30, 34, 38) hit <- lapply(difMH[idx], function(x) length(intersect(x$DIFitems, comp))) falarm <- lapply(difMH[idx], function(x) length(setdiff(x$DI