Closed jjgillis0 closed 7 months ago
Hi Professor Young, When calculating the mean I am getting a numeric (0) with the following code:
ideg.CocaineDealingNet <- colSums( as.matrix(CocaineDealingNet) ) mean.i.deg <- sum( ideg.CocaineDealingNet ) / dim( CocaineDealingNet )[1] odeg.CocaineDealingNet <- rowSums( as.matrix(CocaineDealingNet) ) mean.o.deg <- sum( odeg.CocaineDealingNet ) / dim( CocaineDealingNet )[1] mean.i.deg
Hi @jjgillis0! In the second line, you need to coerce the object CocaineDealingNet to be a matrix. Like this:
CocaineDealingNet
mean.i.deg <- sum( ideg.CocaineDealingNet ) / dim( as.matrix( CocaineDealingNet ) )[1]
Hi Professor Young, When calculating the mean I am getting a numeric (0) with the following code:
4. Calculate the mean indegree and outdegree.