Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changes for new variablesList/ data reading #115

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions R/networkanalysis.R
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,13 @@ NetworkAnalysis <- function(jaspResults, dataset, options) {
groupingVariable <- options[["groupingVariable"]]
vars2read <- c(variables, groupingVariable)
vars2read <- vars2read[vars2read != ""]
exclude <- c()
if (options[["missingValues"]] == "listwise")
exclude <- vars2read
dataset <- .readDataSetToEnd(columns.as.numeric = vars2read, exclude.na.listwise = exclude)

exclude <- if (options[["missingValues"]] == "listwise")
c(vars2read, groupingVariable)
else if (groupingVariable != "")
exclude <- groupingVariable

dataset <- .readDataSetToEnd(columns.as.numeric = variables, columns.as.factor = if (groupingVariable != "") groupingVariable else NULL, exclude.na.listwise = exclude)
# dataset <- .readDataSetToEnd(columns = vars2read, exclude.na.listwise = exclude) # jaspTools need this, JASP the line above

if (options[["groupingVariable"]] == "") { # one network
Expand Down
32 changes: 16 additions & 16 deletions inst/qml/BayesianNetworkAnalysis.qml
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ Form
VariablesForm
{
AvailableVariablesList { name: "allVariablesList" }
AssignedVariablesList { name: "variables"; title: qsTr("Dependent Variables"); suggestedColumns: ["scale"]; id: networkVariables}
AssignedVariablesList { name: "groupingVariable"; title: qsTr("Split"); singleVariable: true; suggestedColumns: ["ordinal", "nominal"] }
AssignedVariablesList { name: "variables"; title: qsTr("Dependent Variables"); allowedColumns: ["scale"]; minNumericLevels: 2; id: networkVariables}
AssignedVariablesList { name: "groupingVariable"; title: qsTr("Split"); singleVariable: true; allowedColumns: ["nominal"]; minLevels: 2 }
}

DropDown
{
id: estimator
Expand All @@ -47,8 +47,8 @@ Form
{
title: qsTr("Plots")
CheckBox { name: "networkPlot"; label: qsTr("Network plot") }
CheckBox {
name: "evidencePlot";
CheckBox {
name: "evidencePlot";
label: qsTr("Edge evidence plot")
IntegerField {
name: "edgeInclusionCriteria";
Expand All @@ -61,12 +61,12 @@ Form
CheckBox { name: "edgeExclusion"; label: qsTr("Evidence for exclusion"); checked: true }
CheckBox { name: "edgeAbsence"; label: qsTr("Absence of evidence"); checked: true }
}
CheckBox {
name: "centralityPlot"; label: qsTr("Centrality plot")
CheckBox {
CheckBox {
name: "centralityPlot"; label: qsTr("Centrality plot")
CheckBox {
name: "credibilityInterval";
label: qsTr("Credibility interval 95%");
checked: false
checked: false
}
}
}
Expand All @@ -75,7 +75,7 @@ Form
{
title: qsTr("Tables")
CheckBox { name: "weightsMatrixTable"; label: qsTr("Weights matrix") }
CheckBox {
CheckBox {
name: "edgeEvidenceTable"; label: qsTr("Edge evidence probability table")
RadioButtonGroup {
name: "evidenceType";
Expand All @@ -87,14 +87,14 @@ Form
}
CheckBox { name: "centralityTable"; label: qsTr("Centrality table") }
}
Section

Section
{
title: qsTr("Sampling Options")
Layout.columnSpan: 2
IntegerField { name: "burnin"; label: qsTr("Burn in: "); value: "5000" ; min: 0; max: iter.value / 2; fieldWidth: 100; id: burnin }
IntegerField { name: "iter"; label: qsTr("Iterations: "); value: "10000" ; min: burnin.value * 2; fieldWidth: 100; id: iter }

SetSeed{}
}

Expand All @@ -103,7 +103,7 @@ Form
title: qsTr("Prior")

FormulaField { name: "gprior"; label: qsTr("Prior edge inclusion (g prior): "); value: "0.5" ; min: 0.001; max: 1; Layout.columnSpan: 2 }

DropDown
{
id: initialConfiguration
Expand Down Expand Up @@ -245,7 +245,7 @@ Form
RadioButton { value: "inNodes"; label: qsTr("In plot"); checked: true }
RadioButton { value: "inLegend"; label: qsTr("In legend") }
}

RadioButtonGroup
{
name: "legend"
Expand Down Expand Up @@ -291,7 +291,7 @@ Form
CheckBox { name: "expectedInfluence"; label: qsTr("Expected influence"); checked: true }
}
}

Section
{
title: qsTr("Network structure selection")
Expand Down
4 changes: 2 additions & 2 deletions inst/qml/NetworkAnalysis.qml
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ Form
VariablesForm
{
AvailableVariablesList { name: "allVariablesList" }
AssignedVariablesList { name: "variables"; title: qsTr("Dependent Variables"); suggestedColumns: ["ordinal", "scale"]; id: networkVariables}
AssignedVariablesList { name: "groupingVariable"; title: qsTr("Split"); singleVariable: true; suggestedColumns: ["ordinal", "nominal"] }
AssignedVariablesList { name: "variables"; title: qsTr("Dependent Variables"); allowedColumns: ["scale"]; minNumericLevels: 2; id: networkVariables}
AssignedVariablesList { name: "groupingVariable"; title: qsTr("Split"); singleVariable: true; allowedColumns: ["nominal"]; minLevels: 2 }
}

DropDown
Expand Down
Loading