R/idxInvert.R

idxInvert <- function(m, idx) {
	if (class(m)=="numeric" | class(m)=="integer") {
		nNodes <- m
	} else {
		nNodes <- try(nrow(m), silent=TRUE)
		if (class(nNodes) == "try-error" | is.null(nNodes)) {
			cat("ERROR: argument 'm' must be a numeric OR an object on which nrow() can be performed.\n\n", geterrmessage())
			return(FALSE)
		}
	}
	
	return(setdiff(1:(nNodes^2), idx))
}

Try the PCIT package in your browser

Any scripts or data that you put into this service are public.

PCIT documentation built on May 1, 2019, 8:10 p.m.