Skip to content

Commit 8c0c1e6

Browse files
Fix
1 parent ee5562c commit 8c0c1e6

File tree

1 file changed

+16
-21
lines changed

1 file changed

+16
-21
lines changed

R/bgm.R

Lines changed: 16 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -539,33 +539,29 @@ bgm = function(x,
539539

540540
if(edge_selection == TRUE) {
541541
if(edge_prior == "Stochastic-Block"){
542-
543-
summarySbm = summary_SBM(cluster_allocations = out$allocations,
544-
dirichlet_alpha = dirichlet_alpha,
545-
lambda = lambda)
546-
547-
output = list(indicator = indicator,
548-
interactions = interactions,
549-
thresholds = thresholds,
550-
components = summarySbm$components,
551-
allocations = summarySbm$allocations,
552-
arguments = arguments)
542+
output = list(
543+
indicator = indicator, interactions = interactions,
544+
thresholds = thresholds, allocations = out$allocations,
545+
arguments = arguments)
546+
class(output) = "bgms"
547+
summary_Sbm = summarySBM(output)
548+
549+
output$components = summary_Sbm$components
550+
output$allocations = summary_Sbm$allocations
553551
} else {
554552

555-
output = list(indicator = indicator,
556-
interactions = interactions,
557-
thresholds = thresholds,
558-
arguments = arguments)
553+
output = list(
554+
indicator = indicator, interactions = interactions,
555+
thresholds = thresholds, arguments = arguments)
559556
}
560557

561558
} else {
562-
output = list(interactions = interactions,
563-
thresholds = thresholds,
564-
arguments = arguments)
559+
output = list(
560+
interactions = interactions, thresholds = thresholds,
561+
arguments = arguments)
565562
}
566563

567564
class(output) = "bgms"
568-
return(output)
569565
} else {
570566
if(edge_selection == TRUE) {
571567
indicator = out$indicator
@@ -614,7 +610,6 @@ bgm = function(x,
614610
allocations = out$allocations,
615611
arguments = arguments)
616612
} else {
617-
618613
output = list(indicator = indicator,
619614
interactions = interactions,
620615
thresholds = thresholds,
@@ -626,6 +621,6 @@ bgm = function(x,
626621
arguments = arguments)
627622
}
628623
class(output) = "bgms"
629-
return(output)
630624
}
625+
return(output)
631626
}

0 commit comments

Comments
 (0)