Skip to content
Snippets Groups Projects
Commit 28e6f3e1 authored by VANRENTERGHEM Théodore's avatar VANRENTERGHEM Théodore
Browse files

corrections

parent ba0b41ba
No related branches found
No related tags found
No related merge requests found
Pipeline #107852 passed with stage
in 6 minutes and 14 seconds
......@@ -25,8 +25,8 @@ getBlocks.SimpleSBM_fit <- function(x, node_names, labels = NULL,
}
if(is.sbmMatrix(node_names)){
res <- data.frame(Nodes_names = node_names$nodes_names$col)
}else if(is.character(node_names)){
res <- data.frame(Nodes_names = node_names)
}else if(is.character(node_names) | is.factor(node_names)){
res <- data.frame(Nodes_names = as.character(node_names))
}else{
stop("node_names should be a character containing nodes names or an 'sbmMatrix'")
}
......@@ -63,8 +63,8 @@ getBlocks.BipartiteSBM_fit <- function(x, node_names,
res <- list(row = data.frame(Nodes_names = node_names$nodes_names$row),
col = data.frame(Nodes_names = node_names$nodes_names$col))
}else if(is.list(node_names)){
res <- list(row = data.frame(Nodes_names = node_names$row),
col = data.frame(Nodes_names = node_names$col))
res <- list(row = data.frame(Nodes_names = as.character(node_names$row)),
col = data.frame(Nodes_names = as.character(node_names$col)))
}else{
stop("node_names should be a list of nodes names or an 'sbmMatrix'")
}
......
......@@ -227,10 +227,10 @@ visSbm.default <- function(x,
#' data_bi <- sbm::fungusTreeNetwork$fungus_tree
#' node_names <- list(row = sbm::fungusTreeNetwork$fungus_names,
#' col = sbm::fungusTreeNetwork$tree_names)
#' my_sbm_bi <- sbm::estimateBipartiteSBM(data_bi,node_names = node_names)
#' my_sbm_bi <- sbm::estimateBipartiteSBM(data_bi)
#'
#'
#' visSbm(my_sbm_bi)
#' visSbm(my_sbm_bi,node_names = node_names)
#'
#' @export
visSbm.BipartiteSBM_fit <- function(x,
......
......@@ -54,9 +54,9 @@ List of parameters
data_bi <- sbm::fungusTreeNetwork$fungus_tree
node_names <- list(row = sbm::fungusTreeNetwork$fungus_names,
col = sbm::fungusTreeNetwork$tree_names)
my_sbm_bi <- sbm::estimateBipartiteSBM(data_bi,node_names = node_names)
my_sbm_bi <- sbm::estimateBipartiteSBM(data_bi)
visSbm(my_sbm_bi)
visSbm(my_sbm_bi,node_names = node_names)
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment