On Mar 23, 2010, at 11:00 PM, Hongwei Dong wrote:
Hi, please use the following the matrix z as the example:
x<-c(2,4,5,7,6,9,8,2,0)
y<-matrix(x,3,3)
z<-apply(y,2,function(x)x/sum(x))
z
[,1] [,2] [,3]
[1,] 0.1818182 0.3181818 0.8
[2,] 0.3636364 0.2727273 0.2
[3,] 0.4545455
Hi, please use the following the matrix z as the example:
x<-c(2,4,5,7,6,9,8,2,0)
y<-matrix(x,3,3)
z<-apply(y,2,function(x)x/sum(x))
z
On Tue, Mar 23, 2010 at 6:59 PM, David Winsemius wrote:
>
> On Mar 23, 2010, at 9:05 PM, Hongwei Dong wrote:
>
> Hi, R-helpers,
>>
>> I'm trying to use R to
2 matches
Mail list logo