diff --git a/R/bayesiannetworkanalysis.R b/R/bayesiannetworkanalysis.R index 509a4c0..94e233f 100644 --- a/R/bayesiannetworkanalysis.R +++ b/R/bayesiannetworkanalysis.R @@ -41,7 +41,7 @@ BayesianNetworkAnalysis <- function(jaspResults, dataset, options) { mainContainer <- jaspResults[["mainContainer"]] if (is.null(mainContainer)) { mainContainer <- createJaspContainer(dependencies = c("variables", "groupingVariable", "estimator", - "burnin", "iter", "gprior", "dfprior")) + "burnin", "iter", "gprior", "dfprior", "setSeed", "seed")) jaspResults[["mainContainer"]] <- mainContainer } .bayesianNetworkAnalysisMainTableMeta(mainContainer, dataset, options) diff --git a/R/networkanalysis.R b/R/networkanalysis.R index 814440f..a02aeff 100644 --- a/R/networkanalysis.R +++ b/R/networkanalysis.R @@ -95,8 +95,11 @@ NetworkAnalysis <- function(jaspResults, dataset, options) { # check if data must be binarized if (options[["estimator"]] %in% c("isingFit", "isingSampler")) { - idx <- colnames(dataset) != options[["groupingVariable"]] - dataset[idx] <- bootnet::binarize(dataset[idx], split = options[["split"]], verbose = FALSE, removeNArows = FALSE) + + for (i in seq_along(dataset)) { + idx <- colnames(dataset[[i]]) != options[["groupingVariable"]] + dataset[[i]][idx] <- bootnet::binarize(dataset[[i]][idx], split = options[["split"]], verbose = FALSE, removeNArows = FALSE) + } if (options[["estimator"]] == "isingFit") { # required check since isingFit removes these variables from the analyses