Skip to content
Prev 266052 / 398502 Next

Coercing Logical array to Numeric array

On 20/07/2011 7:14 AM, Mitra, Sumona wrote:
Usually you don't need to do anything:  if a local is used in 
arithmetic, the values are automatically coerced.  But if you really 
need the conversion, this should work:

newArray <- as.numeric(oldArray)
dim(newArray) <- dim(oldArray)

Duncan Murdoch