search for: test_selector

Displaying 1 result from an estimated 1 matches for "test_selector".

2012 Dec 17
2
Why does matrix selection behave differently when using which?
..."t". If I delete the "which" calls from function "countRows" the resulting sum of matching row numbers is much greater than the number of rows in "t". The table "t" I use can be downloaded from here: https://github.com/groupschoof/PhyloFun/archive/test_selector.zip Unzip the file and read in the table "t" using t <- read.table("test.tbl") The above function "sumRows" is defined as follows: sumRows <- function( tbl, ps ) { sum( sapply(ps, function(x) { t <- if ( is.na(x) ) { tbl[ which(...