Displaying 1 result from an estimated 1 matches for "zerocol".
Did you mean:
zerocool
2008 Jul 18
0
spreading the risk
...x(rbinom(length(prob.matrix),prob=prob.matrix,size=1),nrow=nrow(prob.matrix))
print(binary.matrix)
# CREATE DUMMY ROW AND COL AND
# ADD THEM TO THE MATRIX SO THAT
# LATER ON, WE DON"T HAVE TO WORRY
# ABOUT FILLING AN ELEMENT THAT
# ISN"T THERE
zerorow <- numeric(ncol(binary.matrix)+2)
zerocol <- numeric(nrow(binary.matrix))
#ADD COL TO BEGINNING AND END
tempbinmat <- cbind(zerocol,binary.matrix,zerocol)
# ADD RO TO TOP AND BOTTOM
tempbinmat <- rbind(zerorow,tempbinmat,zerorow)
# GET RID OF NAMES
colnames(tempbinmat) <- NULL
rownames(tempbinmat) <- NULL
# FIND OUT WHERE...