Re: [R] logical to numeric matrix changing dimensions

2010-07-14 Thread Patrick Burns
You want: storage.mode(y) <- "numeric" as said, for instance, on page 49 of 'The R Inferno'. On 14/07/2010 07:04, Felipe Bhering wrote: example: y=(rbind(c(TRUE,TRUE,TRUE),c( FALSE,FALSE,FALSE))) y [,1] [,2] [,3] [1,] TRUE TRUE TRUE [2,] FALSE FALSE FALSE as.numeric(y) [1] 1

[R] logical to numeric matrix changing dimensions

2010-07-13 Thread Felipe Bhering
example: > y=(rbind(c(TRUE,TRUE,TRUE),c( FALSE,FALSE,FALSE))) > y [,1] [,2] [,3] [1,] TRUE TRUE TRUE [2,] FALSE FALSE FALSE > as.numeric(y) [1] 1 0 1 0 1 0 I am trying to make some important matrixes become nuemric (1 or 0) but they change their dimensions.. anyone know how to easily fi

[R] logical to numeric matrix changing dimensions

2010-07-13 Thread Felipe Bhering
example: > y=(rbind(c(TRUE,TRUE,TRUE),c(FALSE,FALSE,FALSE))) > y [,1] [,2] [,3] [1,] TRUE TRUE TRUE [2,] FALSE FALSE FALSE > as.numeric(y) [1] 1 0 1 0 1 0 I am trying to make some important matrixes become nuemric (1 or 0) but they change their dimensions.. anyone know how to easily fix