Displaying 1 result from an estimated 1 matches for "whichres".
Did you mean:
whiches
2008 Jul 18
0
spreading the risk
...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 ALL THE ONES ARE.
# ARR.IND = TRUE GIVES THEM BACK IN MATRIX FORM
whichres <- which(tempbinmat == 1, arr.ind=TRUE)
# THIS LAPPLY GOES THROUGH THE LOCATIONS WHERE
# THERE ARE ONES AND FINDS LOCATIONS WHERE
# ONES NEED TO BE ADDED
onespositions <- lapply(1:nrow(whichres),function(.rownum) {
rightspot <- c(whichres[.rownum,1], whichres[.rownum,2]+1)
leftspot...