#SIMULATING OBSERVED BINARY DATA
#number of binary variables
k <- 6
#building observed profiles matrix
profiles <- sapply((0:(2^k-1)) ,function(x){ as.integer(intToBits(x))})
profiles <- t(profiles[1:k, ])
#building the vector of observation frequencies
weights <- sample.int(100, nrow(profiles), replace=TRUE)
#Chosing (at random) a variable priority
vp <- sample.int(k, k, replace=FALSE)
result <- BidimentionalPosetRepresentation(profiles, weights, vp)
Run the code above in your browser using DataLab