Skip to content

Commit e01535e

Browse files
committed
now new_diffnet sets the num_of behavior internally
1 parent 345df65 commit e01535e

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

R/diffnet-class.r

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -547,8 +547,7 @@ new_diffnet <- function(graph, toa, t0=min(toa, na.rm = TRUE), t1=max(toa, na.rm
547547
self = getOption("diffnet.self"),
548548
multiple = getOption("diffnet.multiple"),
549549
name = "Diffusion Network",
550-
behavior = "Unspecified",
551-
num_of_behaviors = 1
550+
behavior = "Unspecified"
552551
) {
553552

554553
# Step 0.0: Check if its diffnet! --------------------------------------------
@@ -557,6 +556,12 @@ new_diffnet <- function(graph, toa, t0=min(toa, na.rm = TRUE), t1=max(toa, na.rm
557556
return(graph)
558557
}
559558

559+
# Step 0.1: Setting num_of_behavior ------------------------------------------
560+
561+
if (inherits(toa, "matrix")) {
562+
num_of_behaviors <- dim(toa)[2]
563+
} else {num_of_behaviors <- 1}
564+
560565
# Step 1.1: Check graph ------------------------------------------------------
561566
meta <- classify_graph(graph)
562567
if (meta$type=="static")

R/rdiffnet.r

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -500,8 +500,7 @@ rdiffnet <- function(
500500
t1 = t,
501501
vertex.static.attrs = data.frame(real_threshold=thr),
502502
name = name,
503-
behavior = behavior,
504-
num_of_behaviors = num_of_behaviors
503+
behavior = behavior
505504
)
506505
}
507506

0 commit comments

Comments
 (0)