Re: [R] Coercing elements of a matrix from integer to double

From: Peter Dalgaard <>
Date: Mon 04 Sep 2006 - 21:28:46 GMT

"Thaden, John J" <> writes:

> Ive been converting elements of matrices and arrays, e.g., from
> Integers to double-precision, by vectorizing the matrix and then
> remaking it. Alternatively, I can redefine one element as double
> which then redefines them all. Both methods are quick, so I guess
> I shouldn't complain, but I would have thought there'd be something
> more obvious. Have I missed it?

storage.mode(M) <- "double"

   O__  ---- Peter Dalgaard             ุster Farimagsgade 5, Entr.B
  c/ /'_ --- Dept. of Biostatistics     PO Box 2099, 1014 Cph. K
 (*) \(*) -- University of Copenhagen   Denmark          Ph:  (+45) 35327918
~~~~~~~~~~ - (                  FAX: (+45) 35327907

______________________________________________ mailing list
PLEASE do read the posting guide
and provide commented, minimal, self-contained, reproducible code.
Received on Tue Sep 05 07:38:46 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Thu 07 Sep 2006 - 07:51:18 GMT.

Mailing list information is available at Please read the posting guide before posting to the list.