R/net.neighbors.R

net.neighbors <-
function(theta,index)
{
	#index = (row.names(theta[[1]])==name)
	K = length(theta)
	p = dim(theta[[1]])[1]
	neighbors = list()
	for(k in 1:K)
	{
		neighbor.indices = (theta[[k]][index,]!=0)
		neighbor.indices[index] = FALSE
		neighbors[[k]] = row.names(theta[[1]])[neighbor.indices]
	}
	return(neighbors)
}

Try the JGL package in your browser

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

JGL documentation built on May 2, 2019, 12:40 p.m.