[R] data comparison

Rui Barradas ruipbarradas at sapo.pt
Wed Dec 26 15:44:55 CET 2012


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$DIFitems, comp)))


Hope this helps,

Rui Barradas
Em 26-12-2012 12:37, Yung Chih Ou escreveu:
> Dear all:
>
> I have six vector from six DIF detection results.
> as below:
>> difMH[[100]]$DIFitems
>   [1]  1  9 19 21 22 24 25 27 29 30 34 38 40
>> difMH[[90]]$DIFitems
>   [1]  1  2  9 14 18 19 21 22 25 28 30 34 38 39
>> difMH[[80]]$DIFitems
>   [1]  1  8  9 19 21 22 24 25 26 28 30 34 38
>> difMH[[70]]$DIFitems
>   [1]  1  8  9 10 16 18 21 22 25 28 30 32 34 38 39
>> difMH[[60]]$DIFitems
>   [1]  1  9 19 21 22 23 25 27 30 34 36 38 39
>> difMH[[50]]$DIFitems
>   [1]  1  9 10 11 17 18 21 22 23 25 28 30 34 38 39
>
> I have two questions.
>
> first, how to combine these to a matrix?
>
> second, how to compare them with "1 9 21 22 25 30 34 38"
> how much units hit?
> how much units are false-alarm?
>
> thanks!
>
> ______________________________________________
> R-help at r-project.org 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.




More information about the R-help mailing list