Re: [R] Coercing Logical array to Numeric array

2011-07-21 Thread Mitra, Sumona
Dear all, Thank you so much for your help. Best, Sumona __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-c

Re: [R] Coercing Logical array to Numeric array

2011-07-20 Thread David Winsemius
On Jul 20, 2011, at 7:14 AM, Mitra, Sumona wrote: Dear all, Coercing a logical vector to a numeric one is easy. The as.numeric function is used. However what do we use when we have a matrix or an array? Here's one way: > m <-matrix(c("1", "2", "3", "4"),2) > m [,1] [,2] [1,] "1" "

Re: [R] Coercing Logical array to Numeric array

2011-07-20 Thread Duncan Murdoch
On 20/07/2011 7:14 AM, Mitra, Sumona wrote: Dear all, Coercing a logical vector to a numeric one is easy. The as.numeric function is used. However what do we use when we have a matrix or an array? Usually you don't need to do anything: if a local is used in arithmetic, the values are automa

Re: [R] Coercing Logical array to Numeric array

2011-07-20 Thread Mitra, Sumona
Dear all, Coercing a logical vector to a numeric one is easy. The as.numeric function is used. However what do we use when we have a matrix or an array? Sumona __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do