Skip to content

trheshold matrix

2 messages · Alaios, Uwe Ligges

#
Dear all I want to put zeros and ones in matrix I have if the values are over a threshold

For that I use:

origBoolmap<- (origmap >thresh )
origBoolmap[thresh < origmap] <- 1
origBoolmap[thresh >= origmap] <- 0

Could you please tell me if the first line out of the three is useless? I have checked and seems taht I take the same results.

Best Regards
Alex
#
On 03.06.2011 10:09, Alaios wrote:
origBoolmap <- as.numeric(origmap>thresh )

should do it without need for any other code.

Uwe Ligges