R script for community detection and evaluation based on iGraph