Sorry... example 2 was error! 2009/10/22 Romildo Martins <romildo.mart...@gmail.com>
> Hello, > > I need to do an intersection between the list elements (partitionslist) and > the columns and rows of a matrix (mm), so that the result will be the sums > of the rows and columns. > > > Thanks a lot, > > Romildo Martins > > Example > > 1.The Intersection and sum betweeen partitionslist[[1]][[2]] and mm is > indicated in bold. > 2.The Intersection and sum betweeen partitionslist[[1]][[2]] and mm is > indicated in red italic. > > > partitionslist[[1]][[1]] > [1] 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 19 20 21 > > partitionslist[[1]][[2]] > [1] 0 1 2 18 22 > > mm > 1 4 7 10 12 14 19 22 > 1 00000 18128 18576 20048 19408 21472 16528 20432 > 4 20080 00000 20576 23520 19776 19504 21312 22384 > 7 21072 25456 00000 18448 19152 22144 18368 19280 > 10 18624 22880 16256 00000 17856 16032 17008 19120 > 12 20208 15712 17008 23264 00000 23168 19872 24000 > 14 26560 19024 20704 19520 20048 00000 16736 21056 > 19 17600 22640 20704 17200 17312 17728 00000 18912 > 22 18128 19024 21120 17296 20208 19904 21120 00000 > > > > example 1 > 1 4 7 10 12 14 19 22 > 1 00000 18128 18576 20048 19408 21472 16528 *20432* > 4 20080 00000 20576 23520 19776 19504 21312 22384 > 7 21072 25456 00000 18448 19152 22144 18368 19280 > 10 18624 22880 16256 00000 17856 16032 17008 19120 > 12 20208 15712 17008 23264 00000 23168 19872 24000 > 14 26560 19024 20704 19520 20048 00000 16736 21056 > 19 17600 22640 20704 17200 17312 17728 00000 18912 > 22 *18128* 19024 21120 17296 20208 19904 21120 00000 > > example 1: sum is *20432+**18128 > > *> example 2 > 1 4 7 10 12 14 19 22 > *1 *00000* *18128 18576 20048 19408 21472 16528 20432* > 4 *20080* *00000* 20576 23520 19776 19504 21312 *22384* > 7 *21072 *25456 *00000 *18448 19152 22144 18368 *19280* > 10 *18624* 22880 16256 *00000* 17856 16032 17008 *19120* > 12 *20208* 15712 17008 23264 *00000* 23168 19872 *24000* > 14 *26560* 19024 20704 19520 20048 *00000* 16736 21056 > 19 *17600 *22640 20704 17200 17312 17728 *00000* *18912* > 22 *18128 19024 21120 17296 20208 19904 21120 00000 > [[alternative HTML version deleted]] ______________________________________________ R-help@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.