Skip to content
Prev 306162 / 398506 Next

Confused by code?

Hello,

Inline.
Em 24-09-2012 15:31, Bazman76 escreveu:
Yes and no, it should return a logical matrix, not a numeric one. Since 
it seems to be returning numbers 0/1, you can use as.logical like I've 
shown in my first post, or, maybe better,

mI<- which(mRU(de.d, de.nP) > de.CR, arr.ind = TRUE)

Like this you'll have an index matrix, whose purpose is precisely what 
its names says, to index. Matrices.
(I'm also a bit confused as to why the logical condition is returning 
numbers, are you sure of that?)

Anyway, the right way would be to index 'mPV' using a logical or an 
index matrix.

Hope this helps,

Rui Barradas