Setting all the values of the objects to double type in R session -


how can 1 set objects/outputs' values double in r session.

suppose a vector , should return double values if elements integers.

after suppose if define matrix, mm elements in matrix should appear double.

e.g.

suppose mm matrix

mm=matrix(1:10, nrow=2) > mm      [,1] [,2] [,3] [,4] [,5] [1,]    1    3    5    7    9 [2,]    2    4    6    8   10 

my desired output is:

> mm          [,1]   [,2]    [,3]  [,4]   [,5]     [1,]    1.0    3.0    5.0    7.0    9.0     [2,]    2.0    4.0    6.0    8.0   10.0 

can answer this?

thank much.

try: mm <- matrix(as.double(1:10), nrow=2) check via typeof(mm) # "double"


Comments

Popular posts from this blog

Payment information shows nothing in one page checkout page magento -

tcpdump - How to check if server received packet (acknowledged) -