I'm trying to learn how to provide a reproducible R example in case I needed one in the future.
I use the SimSurv()
function and I want to add six new columns (binary variables) to it. These columns' values should not be parallel or intersecting ie. var1
must have the value 1 for elements 1 to 100 and the rest 0; var2
will start at 101 to 200 and so on.
x = SimSurv(600)
var1 = matrix(0:1, nrow=100) # 1 - 100
var2 = matrix(0:1, nrow=100) # 101 - 200
...
var6 = matrix(0:1, nrow=100) # 501 - 600
I can not phrase this one into a legitimate Google search thus I asked here to expound my problem.