Degree centrality

Hi, I am trying to compute degrecentrality. I amm getting the following error
Error in degree(net2, mode = “in”) : unused argument (mode = “in”) when i use degree(net2, mode=“in”).
I can compute other centralities such as Closeness and betweenness
Any solution?

You have probably loaded another package which also provides a degree function, masking igraphs’s degree. Use igraph::degree.

Thank you. That worked.