igraph-help
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[igraph] (no subject)


From: Fandi Furlan
Subject: [igraph] (no subject)
Date: Thu, 27 Jun 2019 13:49:34 -0400


Hello,  


I am currently working on modifying a code I found on the paper " Mutual assessment during ritualized fighting in mantis shrimp" (Green and Patek, 2017) (I sent you the code attached : " code to permute and plot behavioural sequence data ")


My aim was to help my PI generate a code that would take the data that she has (an adjacency matrix counting the transitions from one behavior to another. I sent you one of the matrices attached so you could visualise it) and make the same permutation test that they implemented in the code, but also give her the graphs from her adjacency matrices. 
I managed to do the first thing generating the transition matrix from the adjacency one , but I don't seem to be getting anywhere when it comes to the Igraph part... (I sent you the modified code "Sequential Behavioural Analyss backwards" ) 

The problem that I have is that when I run the original code, there's a problem in this section  : 

#generate the observed adjacency matrix
graph<-graph.data.frame(data,directed = T)
adjacency.matrix<-get.adjacency(graph,sparse=F)
#check that this is a 14x14 matrix for Green & Patek 2017
#if using your own data, the matrix should be n x n for an ethogram with n possible behaviours
adjacency.matrix 


The graph cannot be shown in R and it gives me this error message : 

Error in adjacent_vertices(x, i, mode = if (directed) "out" else "all") : 
  At iterators.c:759 : Cannot create iterator, invalid vertex id, Invalid vertex id


This message appears also whenever I try to look at a graph from the modified code... 

I tried looking at R help and tried to understand a little how the functions work but I really don'tunderstand... If you could give me just some theoretical insight in how this works, it would b really useful. 
I may not be clear, if you need more information or some clarifications please let me know. 

Sorry to bother you and thank you for your time, 

Attachment: rspb20172542_si_005.txt
Description: Text document

Attachment: Adjacency_matrix_TVeh.csv
Description: Text Data

Attachment: Sequencial Behavioural Analysis backwards (1).R
Description: Binary data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]