Skip to content

Commit

Permalink
now new_diffnet sets the num_of behavior internally
Browse files Browse the repository at this point in the history
  • Loading branch information
aoliveram committed Nov 19, 2024
1 parent 345df65 commit e01535e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
9 changes: 7 additions & 2 deletions R/diffnet-class.r
Original file line number Diff line number Diff line change
Expand Up @@ -547,8 +547,7 @@ new_diffnet <- function(graph, toa, t0=min(toa, na.rm = TRUE), t1=max(toa, na.rm
self = getOption("diffnet.self"),
multiple = getOption("diffnet.multiple"),
name = "Diffusion Network",
behavior = "Unspecified",
num_of_behaviors = 1
behavior = "Unspecified"
) {

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

# Step 0.1: Setting num_of_behavior ------------------------------------------

if (inherits(toa, "matrix")) {
num_of_behaviors <- dim(toa)[2]
} else {num_of_behaviors <- 1}

# Step 1.1: Check graph ------------------------------------------------------
meta <- classify_graph(graph)
if (meta$type=="static")
Expand Down
3 changes: 1 addition & 2 deletions R/rdiffnet.r
Original file line number Diff line number Diff line change
Expand Up @@ -500,8 +500,7 @@ rdiffnet <- function(
t1 = t,
vertex.static.attrs = data.frame(real_threshold=thr),
name = name,
behavior = behavior,
num_of_behaviors = num_of_behaviors
behavior = behavior
)
}

Expand Down

0 comments on commit e01535e

Please sign in to comment.