I cleaned up your function a bit but please double check
generate.matrix - function(nr, runs=5){
h - nr/2## half of nr
nc - nr/10 + 1
mat - matrix(0, nr, nc) ## initialize
mat[ ,1] - c( rep(1, h), rnorm(h) ) ## 1st
Hi R users
Here is what I got with help from Petr Pikal (Thanks Petr Pikal). I modified
Petr Pikal's code to a little
to meet my purpose.
I created a function to generate a matrix
generate.matrix-function(n.variable)
{
mat-matrix(0,n.variable,(n.variable/2)/5+1) #matrix of zeroes
dd-dim(mat) #