Re: [R] digits in matrix

2015-01-30 Thread Duncan Murdoch
On 30/01/2015 8:17 AM, Knut Krueger wrote: Am 30.01.2015 um 12:51 schrieb Duncan Murdoch: > You are mixing up formatting with storage. Floating point numbers will > be displayed without decimals if they are close enough to whole numbers. > > Duncan Murdoch > Ok, I am talking from display data

Re: [R] digits in matrix

2015-01-30 Thread Knut Krueger
Am 30.01.2015 um 12:51 schrieb Duncan Murdoch: You are mixing up formatting with storage. Floating point numbers will be displayed without decimals if they are close enough to whole numbers. Duncan Murdoch Ok, I am talking from display data = matrix(c(1:16),nrow=4,ncol=4) #create matrix da

Re: [R] digits in matrix

2015-01-30 Thread PIKAL Petr
Hi > -Original Message- > From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Knut > Krueger > Sent: Friday, January 30, 2015 12:32 PM > To: r-help@r-project.org > Subject: Re: [R] digits in matrix > > Am 30.01.2015 um 11:50 schrieb PIKAL Petr: > &g

Re: [R] digits in matrix

2015-01-30 Thread Duncan Murdoch
On 30/01/2015 6:31 AM, Knut Krueger wrote: > Am 30.01.2015 um 11:50 schrieb PIKAL Petr: >> >> You cannot. Matrix is a vector with dimensions so basically it has to have >> the same mode and type of data. >> >> The only way I can think about is to split matrix to 3 matrices before >> making calcul

Re: [R] digits in matrix

2015-01-30 Thread Knut Krueger
Am 30.01.2015 um 11:50 schrieb PIKAL Petr: You cannot. Matrix is a vector with dimensions so basically it has to have the same mode and type of data. The only way I can think about is to split matrix to 3 matrices before making calculation an keep those 3 matrices separate. Cheers Petr bu

Re: [R] digits in matrix

2015-01-30 Thread PIKAL Petr
Hi > -Original Message- > From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Knut > Krueger > Sent: Friday, January 30, 2015 11:21 AM > To: r-h...@stat.math.ethz.ch > Subject: [R] digits in matrix > > I have a matrix winth integer values after an ari

[R] digits in matrix

2015-01-30 Thread Knut Krueger
I have a matrix winth integer values after an arithmetic calulation How can prevent the [1:3]1:3] part of the matrix to be converted to floats data = matrix(c(1:16),nrow=4,ncol=4) #create matrix data[4,] = data[4,]/3 data[,4] = data[,4]/3 data Kind regards Knut ___