[R] Transforming matrix

Spencer Graves spencer.graves at pdf.com
Thu Apr 10 16:21:59 CEST 2003


 > A <- array(c(T,F,F,T), dim=c(2,2))
 > A+0
      [,1] [,2]
[1,]    1    0
[2,]    0    1

How's this?
Spencer Graves

Ramzi Feghali wrote:
> hi everybody, 
> anyone knows how we can transform a binary matrix with TRUE and FALSE to 0 and 1 without looping? 
> Thx 
> 
> 
> 
> ---------------------------------
> 
> 
> 	[[alternate HTML version deleted]]
> 
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://www.stat.math.ethz.ch/mailman/listinfo/r-help



More information about the R-help mailing list