Hi- I am trying to do a principle component analysis for measures of centrality and on my last line of code below it returns the error "Error in calculate_centralities(Advice_Network, include = pr_cent[7, 11, :
The input is not an igraph object or may not be connected." - Note that I have checked the class of the Advice_ Network by doing class(Advice_Network) and it returned that it is igraph.
my_data <- read.csv(file.choose(), header=TRUE, row.names=1)
my_advicematrix <- as.matrix(my_data)
Advice_Network <- graph.adjacency(my_advicematrix,mode="directed",diag=FALSE)
calculate_centralities(Advice_Network, include = pr_cent[7,11,15]) %>%
pca_centralities(scale.unit = TRUE)