From 27c88579a799d5ae8dfd72980b5b00dc012e5a09 Mon Sep 17 00:00:00 2001
From: "Pavel N. Krivitsky"
Date: Sat, 21 May 2022 17:46:42 +1000
Subject: [PATCH] as.matrix.network.adjacency() for a bipartite network no
longer drops dimensions if the matrix has 1 actor and/or 1 event.
fixes statnet/network#69
---
DESCRIPTION | 4 ++--
R/coercion.R | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/DESCRIPTION b/DESCRIPTION
index 338b0cb..76750cf 100644
--- a/DESCRIPTION
+++ b/DESCRIPTION
@@ -1,6 +1,6 @@
Package: network
-Version: 1.17.1-685
-Date: 2021-06-08
+Version: 1.17.1-747
+Date: 2022-05-21
Title: Classes for Relational Data
Authors@R: c(
person("Carter T.", "Butts", role=c("aut","cre"), email="buttsc@uci.edu"),
diff --git a/R/coercion.R b/R/coercion.R
index 25ce6f9..6aa8645 100644
--- a/R/coercion.R
+++ b/R/coercion.R
@@ -208,7 +208,7 @@ as.matrix.network.adjacency<-function(x,attrname=NULL,expand.bipartite=FALSE,...
if(is.bipartite(x)&(!expand.bipartite)){
nactors <- get.network.attribute(x, "bipartite")
nevents <- network.size(x) - nactors
- m <- m[0:nactors, nactors+(1:nevents)]
+ m <- m[1:nactors, nactors+(1:nevents), drop=FALSE]
}
#Return the result
m