Hi Paul,
I am not sure I understand your question, but perhaps the following is helpful.
In particular, the apply() function used with MAR=1, applies a
function to a matrix row-wise.
set.seed(123)
m <- matrix(sample(1:6,5*12,replace=TRUE),ncol=12) ## dummy data
m
[,1] [,2] [,3] [,4] [,5] [,6]
Dear R friends,
One question, so, thanks to the Bert's kind feedback, I was able to create
my matrix using the following code:
dice_rolls = 120
num_dice = 1
dice_sides = 6
#performing simulation
dice_simul = data.frame(dice(rolls = dice_rolls, ndice = num_dice, sides =
dice_sides, plot.it = TRU
2 matches
Mail list logo