# Cannot find function "graph\_from\_adjacency\_matrix"

**URL:** <https://igraph.discourse.group/t/cannot-find-function-graph-from-adjacency-matrix/416>\
**Category:** Usage\
**Tags:** R\
**Created:** [21 August 2020 10:16 UTC](https://igraph.discourse.group/t/cannot-find-function-graph-from-adjacency-matrix/416 "2020-08-21T10:16:04Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sergey\_LIM](https://yyz2.discourse-cdn.com/free1/user_avatar/igraph.discourse.group/sergey_lim/32/338_2.png) [@Sergey\_LIM](https://igraph.discourse.group/u/Sergey_LIM)\
**Post date:** [21 August 2020 10:16 UTC](https://igraph.discourse.group/t/cannot-find-function-graph-from-adjacency-matrix/416/1 "2020-08-21T10:16:04Z")

</div>

Dear, Colleagues

I am doing microbiome analysis.

[Educational article](https://kelseyandersen.github.io/NetworksPlantPathology/Microbiome_network_ICPP2018_v2.html)

And at this point I am getting the error.

> net.grph = graph.adjacency (adjm, mode = “undirected”, weighted = TRUE, diag = FALSE)  
> Error in graph.adjacency (adjm, mode = “undirected”, weighted = TRUE, diag = FALSE):  
> cannot find function “graph.adjacency”

It doesn’t help either

> net.grph = graph\_from\_adjacency\_matrix(adjm, mode = “undirected”, weighted = TRUE, diag = FALSE)

cannot find function “graph\_from\_adjacency\_matrix”

Please tell me what could be the problem?  
R-studio 1.2.5042  
R version 3.6.3 (2020-02-29)  
igraph 1.2.5

---

<div class="post-metadata">

**Author:** ![szhorvat](https://yyz2.discourse-cdn.com/free1/user_avatar/igraph.discourse.group/szhorvat/32/3_2.png) [@szhorvat](https://igraph.discourse.group/u/szhorvat)\
**Post date:** [21 August 2020 11:09 UTC](https://igraph.discourse.group/t/cannot-find-function-graph-from-adjacency-matrix/416/2 "2020-08-21T11:09:26Z")

</div>

You must load igraph, `library(igraph)`. Any R package must be loaded before it can be used.

---

<div class="post-metadata">

**Author:** ![Sergey\_LIM](https://yyz2.discourse-cdn.com/free1/user_avatar/igraph.discourse.group/sergey_lim/32/338_2.png) [@Sergey\_LIM](https://igraph.discourse.group/u/Sergey_LIM)\
**Post date:** [22 August 2020 04:06 UTC](https://igraph.discourse.group/t/cannot-find-function-graph-from-adjacency-matrix/416/3 "2020-08-22T04:06:12Z")

</div>

> [@szhorvat](#):
>
> You must load igraph, `library(igraph)` . Any R package must be loaded before it can be used.

Thanks for the answer. This is the problem, I know to install and run the package first. I did it.

---

<div class="post-metadata">

**Author:** ![Sergey\_LIM](https://yyz2.discourse-cdn.com/free1/user_avatar/igraph.discourse.group/sergey_lim/32/338_2.png) [@Sergey\_LIM](https://igraph.discourse.group/u/Sergey_LIM)\
**Post date:** [22 August 2020 04:53 UTC](https://igraph.discourse.group/t/cannot-find-function-graph-from-adjacency-matrix/416/4 "2020-08-22T04:53:13Z")

</div>

I solved the problem. Need to upgrade to R 4.0.2 R-studio 1.2.5042
