[R] How to doulbe all the value on a matrix

David Winsemius dwinsemius at comcast.net
Mon Jan 17 22:08:04 CET 2011


On Jan 17, 2011, at 11:16 AM, ADias wrote:

>
> Hi,
>
> yes it works perfectly.
>
> I have another question:
>
> Is there way of selecting with a vector the values I wish to take  
> out from a
> matrix.
>
> Example:
>
> I have this matrix and I want to take out the numbers in bold and  
> get the
> second matrix below

This is a plain text mailing list (despite what the Nabble mirror may  
(mis-)lead you into believing) ... no bold.

-- 
david.
>
>> m
>      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
> [1,]   17    1    6    5   19    2   19    1   15     8
> [2,]    7    7   20    3    2   16    9    9   19    13
> [3,]    2    4    3   11   18   11   14   13    3     1
> [4,]    3    7    5    7   17   18   10    6    5    15
> [5,]    8   20   13   10    8   12   20   19    1    16
> [6,]    9   14    1   12   12   12   17   18   10    17
> [7,]    3   10   11    2   12    9   18    6   19     9
> [8,]   13    2   17   16   18    8    9   14    9    16
> [9,]    9    4   11    4    1   17    9    7   20    12
> [10,]    9    1    4    8    8   19   19    8   17    18
>
>     [,1] [,2] [,3] [,4]
> [1,]    7    3   16    9
> [2,]    3    2    9   18
> [3,]   13   16    8    9
>
> thanks
> AD
>
> -- 
> View this message in context: http://r.789695.n4.nabble.com/How-to-doulbe-all-the-value-on-a-matrix-tp3221213p3221230.html
> Sent from the R help mailing list archive at Nabble.com.
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.

David Winsemius, MD
West Hartford, CT



More information about the R-help mailing list