title: How to fix: Error in graph.adjacency.densen Non-square matrix, Non-square matrix
body: <p>I am trying to do a network analysis and after some qualitative data about culture I want to see how my culture nodes are related to each other. To do this I created a csv file in Excel with 46 rows and columns, aka it is a squared matrix. I tried the following two sets of code to get a network output in R.</p>
  
  <p>First attempt (did not work):</p>
  
  <pre><code>library(igraph)
  my_data &lt;- read.csv(file.choose(),header=TRUE, row.names=NULL)
  my_matrix &lt;- as.matrix(my_data)
  my_first_network &lt;- 
  graph.adjacency(my_matrix,mode="undirected",diag=FALSE)
  my_first_network
  plot(my_first_network)
  </code></pre>
  
  <p>I got these errors:</p>
  
  <blockquote>
    <p>Error in graph.adjacency.dense(adjmatrix, mode = mode, weighted = weighted, :<br>
    At structure_generators.c:274 : Non-square matrix, Non-square matrix<br>
    In addition:<br>
    Warning message:<br>
    In mde(x) : NAs introduced by coercion</p>
  </blockquote>
  
  <p>Second attempt (also didn't work):</p>
  
  <pre><code>my_data &lt;- read.csv(file.choose(),sep=",",header=TRUE)
  nodelist &lt;- names(my_data)[-1]
  my_matrix &lt;- as.matrix(my_data) [,-1]
  rownames(my_matrix) &lt;- colnames(my_matrix) &lt;- nodelist
  my_matrix
  library(igraph)
  g &lt;- graph_from_adjacency_matrix(my_matrix, mode="undirected", 
  weighted=NULL)
  plot(g)
  </code></pre>
  
  <p>Got these errors:</p>
  
  <blockquote>
    <p>Error in graph.adjacency.dense(adjmatrix, mode = mode, weighted = weighted,  :<br>
    At structure_generators.c:274 : Non-square matrix, Non-square matrix</p>
  </blockquote>
  
  <p>Could anybody help me by telling me what the problem is, how I can fix the code to get my network? </p>
  
  <p>Thank you very much in advance</p>