Displaying 1 result from an estimated 1 matches for "dmatrx".
Did you mean:
dmatrix
2012 Mar 17
3
rtriang using ifelse statement
...tement to fix this, or must I take an entirely
different approach? Many thanks for your help.
> matrx <- matrix(c(2, 1, 1, 2, 2,1), nc=nx)
> matrx
[,1] [,2] [,3]
[1,] 2 1 2
[2,] 1 2 1
> # rtriang from mc2d package: function (n, min = -1, mode = 0, max = 1)
>* dmatrx<- ifelse(matrx==1, rtriang(4, min=0.001, mode=matrx, max=2.001),
rtriang(4, min=2, mode=matrx, max=3))*
Warning message:
In rtriang(4, min = 2, mode = matrx, max = 3) : NaN in rtriang
> dmatrx
[,1] [,2] [,3]
[1,] 2.7627761 1.305099 2.7627761
[2,] 0.6158242 2.218274 0.615824...