ctr <- rsctrl(burn_in = 10, n_eff = 5, step=10, seed = 12345678, tfixed = FALSE)
mat <- matrix(sample(c(0,1), 50, replace = TRUE), nr = 10)
rso <- rsampler(mat, ctr)
rso_st <- rstats(rso,phi)
unlist(rso_st)
# extract the third generated matrix
# (here, the first is the input matrix)
# and decode it into rsmat
rso2 <- rsextrobj(rso,4,4)
summary(rso2)
rsmat <- rstats(rso2, function(x) m<-matrix(x, nr = rso2$n) )
print(rsmat)
# apply a user function to the decoded object
print(phi(rsmat[[1]]))
Run the code above in your browser using DataLab