Re: [R] with data in the form of an R data objecte: Monte Carlo simulation in R

2010-03-24 Thread David Winsemius
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

[R] with data in the form of an R data objecte: Monte Carlo simulation in R

2010-03-23 Thread Hongwei Dong
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 dwinsem...@comcast.netwrote: On Mar 23, 2010, at 9:05 PM, Hongwei Dong wrote: Hi, R-helpers, I'm trying