Watts-College / crj-507-spring-2024

https://watts-college.github.io/crj-507-spring-2024/
MIT License
1 stars 0 forks source link

Lab #5 Part 1 Question 2 #25

Closed n-galanos closed 6 months ago

n-galanos commented 6 months ago

Hello, I am running into an error when working on calculating the density of the network (Part 1 question 2).

L <- sum( PaulRevereNet )

N <- dim( PaulRevereNet )[1]

M <- dim( PaulRevereNet )[2]

density.PaulRevereNet <- L / ( N M ) Error in L/(N M) : non-numeric argument to binary operator

CGUEVARR commented 6 months ago

Nicole- did you create a matrix from the network yet? That might be your issue. Try adding the following code to your set up....

dim( as.matrix( PaulRevereNet ) )[1]

n-galanos commented 6 months ago

that worked, thank you!

jacobtnyoung commented 6 months ago

Thanks @CGUEVARR for the assist! Glad you figured it out @n-galanos !