how do i clean my social network

As you have been told on other posts before, please make your questions with a reprex, currently your example is not reproducible because you are not including the libraries you are using nider the output you are getting.
I'm going to make a the reprex for your question this time, because this makes easier for others to help you, but you can do the same by following this simple guide
https://forum.posit.co/t/faq-how-to-do-a-minimal-reproducible-example-reprex-for-beginners/23061/1

library(igraph)
library(dplyr)

attach(quakes)
cutfor_graph=cut(depth,6)
data_for_graph=mutate(quakes,cutfor_graph)
eg=make_empty_graph(n=1000,directed = F)
plot.igraph(eg,layout=as.matrix(select(data_for_graph,lat,long)),vertex.color=data_for_graph$cutfor_graph,vertex.size=data_for_graph$mag*5, main="network of quakes")
legend("bottomleft",legend=levels(as.factor(cutfor_graph)),col = c("red","blue","black","yellow","orange","green"),lty=2,pch=20 , pt.cex = 4, cex = 1 )

Created on 2019-03-17 by the reprex package (v0.2.1)