Birds

Weighted multi-relational networks from the paper

Nikola Dragić, Oded Keynan, Amiyaal Ilany: Multilayer social networks reveal the social complexity of a cooperatively breeding bird. iScience, Volume 24, Issue 11, 19 November 2021, 103336

Focal observations of Arabian babblers (Argya squamiceps). The folder contains adjacency matrices of nine social groups observed between 2017 and 2020. Some of the groups were observed multiple times, the complete list of group rounds is also provided. We recorded six different interaction types, hence the folder contains a total of 114 adjacency matrices.

> wdir <- "C:/Users/vlado/DL/data/multi/multilayer/birds"
> setwd(wdir) 
> F <- c(dir(pattern="csv"),"XXX.yyy.csv") # add sentinel
> type <- c("aggression","allofeeding","allopreening",                                                                              
+           "group_foraging","playing","scrounging")
>
> info <- list(network="birds",
+   by=c("Dragić, Nikola","Keynan, Oded","Ilany, Amiyaal"),
+   title="Multilayer social networks reveal the social complexity of a cooperatively breeding bird",
+   url="https://www.sciencedirect.com/science/article/pii/S2589004221013055",
+   creator="V. Batagelj",date=date())
> ways <- list(V1="source",V2="target",type="interaction type")
> nodes <- list(); links <- list(); data <- list()
> NM <- list(format="MWnets",info=info,ways=ways,nodes=nodes,links=links,data=data)
> 
> old <- "XXX"
> for(f in F){fc <- strsplit(f,"\\.")[[1]]; group <- fc[1]; itype <- fc[2]
+   if(group!="XXX") M <- as.matrix(read.csv(f)[-1])
+   if(group!=old) {
+     if(old!="XXX") {
+       D$type <- as.integer(factor(D$type,levels=type))
+       MN <- NM; MN$links <- D
+       MN$info$network <- paste("birds",old)
+       MN$nodes <- list(V1=data.frame(ID=nam),V2=data.frame(ID=nam),
+         type=data.frame(ID=type))
+       write(toJSON(MN),paste(old,".json",sep=""))
+     }
+     old <- group; cat(old,"\n"); nam <- colnames(M); n <- nrow(M); 
+     D <- data.frame(V1=integer(),V2=integer(),type=character(),w=integer(),
+       stringsAsFactors=FALSE)
+   }
+   for(i in 1:n) for(j in 1:n) 
+     if(M[i,j]>0) D <- rbind(D,data.frame(V1=i,V2=j,type=itype,w=M[i,j]))
+ }
ARU_01 
ARU_02 
BER_01 
BER_02 
BOR_01 
BOR_02 
BOR_03 
HIL_01 
HVR_01 
KOT_01 
KOT_02 
NIS_02 
NIS_04 
NIS_05 
THG_01 
THG_02 
THG_03 
THG_04 
ZEV_01 
XXX 

We obtained 19 networks on json files.

> MN <- fromJSON("HVR_01.json")
> str(MN)
List of 6
 $ format: chr "MWnets"
 $ info  :List of 6
  ..$ network: chr "birds HVR_01"
  ..$ by     : chr [1:3] "Dragić, Nikola" "Keynan, Oded" "Ilany, Amiyaal"
  ..$ title  : chr "Multilayer social networks reveal the social complexity of a cooperatively breeding bird"
  ..$ url    : chr "https://www.sciencedirect.com/science/article/pii/S2589004221013055"
  ..$ creator: chr "V. Batagelj"
  ..$ date   : chr "Wed Jan 11 02:07:23 2023"
 $ ways  :List of 3
  ..$ V1  : chr "source"
  ..$ V2  : chr "target"
  ..$ type: chr "interaction type"
 $ nodes :List of 3
  ..$ V1  :'data.frame':        10 obs. of  1 variable:
  .. ..$ ID: chr [1:10] "V1" "V2" "V3" "V4" ...
  ..$ V2  :'data.frame':        10 obs. of  1 variable:
  .. ..$ ID: chr [1:10] "V1" "V2" "V3" "V4" ...
  ..$ type:'data.frame':        6 obs. of  1 variable:
  .. ..$ ID: chr [1:6] "aggression" "allofeeding" "allopreening" "group_foraging" ...
 $ links :'data.frame': 272 obs. of  4 variables:
  ..$ V1  : int [1:272] 1 1 1 2 2 2 2 2 2 3 ...
  ..$ V2  : int [1:272] 2 7 8 3 5 6 7 8 9 1 ...
  ..$ type: int [1:272] 1 1 1 1 1 1 1 1 1 1 ...
  ..$ w   : int [1:272] 4 1 3 2 1 4 7 2 2 1 ...
 $ data  : list()

List of network sizes

 
> for(f in dir(pattern="json")){
+   MN <- fromJSON(f); N <- MN$nodes; L <- MN$links
+   cat(f,"(",length(N$V1$ID),",",length(N$V2$ID),",",length(N$type$ID),",",
+     length(L$V1),")\n")
+ }
ARU_01.json ( 10 , 10 , 6 , 345 )
ARU_02.json ( 6 , 6 , 6 , 112 )
BER_01.json ( 9 , 9 , 6 , 266 )
BER_02.json ( 9 , 9 , 6 , 173 )
BOR_01.json ( 6 , 6 , 6 , 102 )
BOR_02.json ( 8 , 8 , 6 , 216 )
BOR_03.json ( 7 , 7 , 6 , 149 )
HIL_01.json ( 7 , 7 , 6 , 119 )
HVR_01.json ( 10 , 10 , 6 , 272 )
KOT_01.json ( 9 , 9 , 6 , 260 )
KOT_02.json ( 6 , 6 , 6 , 76 )
NIS_02.json ( 11 , 11 , 6 , 384 )
NIS_04.json ( 15 , 15 , 6 , 722 )
NIS_05.json ( 14 , 14 , 6 , 463 )
THG_01.json ( 6 , 6 , 6 , 131 )
THG_02.json ( 6 , 6 , 6 , 87 )
THG_03.json ( 10 , 10 , 6 , 341 )
THG_04.json ( 10 , 10 , 6 , 235 )
ZEV_01.json ( 8 , 8 , 6 , 193 )
> 
vlado/work/2m/mwn/birds.txt · Last modified: 2023/01/11 03:11 by vlado
 
Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Noncommercial-Share Alike 3.0 Unported
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki