Skip to content

Commit 7d0186f

Browse files
Add check for igraph package when generating data
1 parent 184d30a commit 7d0186f

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

R/ccdrAlgorithm-mvn.R

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,10 @@
4040
#'
4141
#' @export
4242
generate_mvn_data <- function(graph, params, n = 1, ivn = NULL, ivn.rand = TRUE){
43+
### This function requires the 'igraph' package to be installed
44+
if (!requireNamespace("igraph", quietly = TRUE)) {
45+
stop("The igraph package is required for the method 'generate_mvn_data'. Please install it using install.packages(\"igraph\").", call. = FALSE)
46+
}
4347

4448
stopifnot(sparsebnUtils::is.edgeList(graph))
4549
stopifnot(is.numeric(params))

0 commit comments

Comments
 (0)