I've created a graph from an adjacency matrix using the igraph package but I want edges to appear in the graph only when the value in the adjacency matrix is beyond a particular threshold. Using the present method I am getting all the edges which have non zero weights.
set.seed(42)
iris_matrix <- as.matrix(iris[,1:4])
image(iris_matrix)
g<-cor(iris_matrix)
library(igraph)
R<-graph.adjacency(g, mode=c("undirected"), weighted=TRUE, diag=FALSE, add.colnames=NULL, add.rownames=NULL)
plot(R)