Message-ID: <1295281872760-3221231.post@n4.nabble.com>
Date: 2011-01-17T16:31:12Z
From: Dieter Menne
Subject: How to doulbe all the value on a matrix
In-Reply-To: <1295272411680-3221213.post@n4.nabble.com>
ADias wrote:
>
> Is there an expression to double the values of a matrix - without using a
> loop?
>
>
Why so complicated?
Dieter
> m = matrix(rep(1,20),nrow=4)
> m
[,1] [,2] [,3] [,4] [,5]
[1,] 1 1 1 1 1
[2,] 1 1 1 1 1
[3,] 1 1 1 1 1
[4,] 1 1 1 1 1
> m*3
[,1] [,2] [,3] [,4] [,5]
[1,] 3 3 3 3 3
[2,] 3 3 3 3 3
[3,] 3 3 3 3 3
[4,] 3 3 3 3 3
>
--
View this message in context: http://r.789695.n4.nabble.com/How-to-doulbe-all-the-value-on-a-matrix-tp3221213p3221231.html
Sent from the R help mailing list archive at Nabble.com.