Skip to content

Commit

Permalink
Merge branch 'master' into 2_3Varsummaries
Browse files Browse the repository at this point in the history
  • Loading branch information
Vitalis95 authored Nov 27, 2024
2 parents 1a39a29 + 0d1280d commit 420906c
Show file tree
Hide file tree
Showing 26 changed files with 1,212 additions and 1,019 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/release-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ jobs:
- name: Checkout Instat Data
uses: actions/checkout@v3
with:
repository: ' africanmathsinitiative/R-Instat-Data'
repository: ' IDEMSInternational/R-Instat-Data'
fetch-depth: 0
path: 'InstatData'

Expand Down
33 changes: 8 additions & 25 deletions instat/UserTables/sdgTableOptions.vb
Original file line number Diff line number Diff line change
Expand Up @@ -41,16 +41,12 @@ Public Class sdgTableOptions
End Sub

''' <summary>
''' An R operateor that has a parameter named "gt" set up.
''' The parameter should be an R Function that generates script "gt:gt()" as part of the last script statement.
''' Sets up the sub dialog.
''' Expected to be called before showing the dialog.
''' </summary>
''' <param name="clsNewOperator"></param>
''' <param name="strDataFrameName">Name of the data frame contained in the data book</param>
''' <param name="clsNewOperator">R operator that has a 'gt' parameter that produces a 'gt' object.</param>
Public Sub Setup(strDataFrameName As String, clsNewOperator As ROperator)
If clsTablesUtils.FindRFunctionsParamsWithRCommand({"gt"}, clsNewOperator).Count = 0 Then
MsgBox("Developer Error: Parameter with 'gt' as name MUST be set up before using this subdialog")
Exit Sub
End If

clsOperator = clsNewOperator

ucrHeader.Setup(clsOperator)
Expand Down Expand Up @@ -80,25 +76,12 @@ Public Class sdgTableOptions
' Themes

Private Sub SetupTheme(clsOperator As ROperator)
clsThemeRFunction = New RFunction

' Uncheck then the check radio button to forces the panel to raise its ControlValueChanged event
rdoSelectTheme.Checked = False
rdoSelectTheme.Checked = True

If Not clsOperator.ContainsParameter("theme_format") Then
Exit Sub
End If

clsThemeRFunction = clsOperator.GetParameter("theme_format").clsArgumentCodeStructure

If clsThemeRFunction.strRCommand = "tab_options" Then
rdoManualTheme.Checked = True
If clsOperator.ContainsParameter("theme_format") Then
clsThemeRFunction = clsOperator.GetParameter("theme_format").clsArgumentCodeStructure
Else
rdoSelectTheme.Checked = True
ucrCboSelectThemes.SetName(clsThemeRFunction.strRCommand)
clsThemeRFunction = New RFunction
clsThemeRFunction.SetPackageName("gtExtras")
End If

End Sub

Private Sub ucrPnlThemes_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrPnlThemesPanel.ControlValueChanged
Expand Down
3 changes: 1 addition & 2 deletions instat/dlgClimaticSummary.vb
Original file line number Diff line number Diff line change
Expand Up @@ -194,8 +194,7 @@ Public Class dlgClimaticSummary

'TODO: what defaults do we want?
clsSummariesList.SetRCommand("c")
clsSummariesList.AddParameter("summary_count_non_missing", Chr(34) & "summary_count_non_missing" & Chr(34), bIncludeArgumentName:=False, iPosition:=1)
clsSummariesList.AddParameter("summary_count", Chr(34) & "summary_count" & Chr(34), bIncludeArgumentName:=False, iPosition:=3)
clsSummariesList.AddParameter("summary_count", Chr(34) & "summary_count" & Chr(34), bIncludeArgumentName:=False, iPosition:=1)
clsSummariesList.AddParameter("summary_sum", Chr(34) & "summary_sum" & Chr(34), bIncludeArgumentName:=False, iPosition:=11)

clsDefaultFunction.SetRCommand(frmMain.clsRLink.strInstatDataObject & "$calculate_summary")
Expand Down
33 changes: 23 additions & 10 deletions instat/dlgColumnStats.vb
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ Public Class dlgColumnStats
clsConcFunction.SetRCommand("c")

clsSummariesList.SetRCommand("c")
clsSummariesList.AddParameter("summary_count_non_missing", Chr(34) & "summary_count_non_missing" & Chr(34), bIncludeArgumentName:=False, iPosition:=1)
clsSummariesList.AddParameter("summary_count", Chr(34) & "summary_count" & Chr(34), bIncludeArgumentName:=False, iPosition:=1)
clsSummariesList.AddParameter("summary_sum", Chr(34) & "summary_sum" & Chr(34), bIncludeArgumentName:=False, iPosition:=11)

clsDefaultFunction.SetRCommand(frmMain.clsRLink.strInstatDataObject & "$calculate_summary")
Expand Down Expand Up @@ -220,19 +220,32 @@ Public Class dlgColumnStats
sdgMissingOptions.ShowDialog()
End Sub

Private Sub ucrReceiverByFactor_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrReceiverByFactor.ControlValueChanged, ucrChkStoreResults.ControlValueChanged, ucrChkPrintOutput.ControlValueChanged
If ucrReceiverByFactor.IsEmpty Then
clsDefaultFunction.AddParameter("store_results", "FALSE", iPosition:=3)
clsDefaultFunction.AddParameter("return_output", "TRUE", iPosition:=4)
ucrBase.clsRsyntax.iCallType = 2
Else
clsDefaultFunction.RemoveParameterByName("return_output")
If ucrChkStoreResults.Checked Then
clsDefaultFunction.AddParameter("store_results", "TRUE", iPosition:=3)
Private Sub ucrReceiverByFactor_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrReceiverByFactor.ControlValueChanged, ucrChkStoreResults.ControlValueChanged, ucrChkPrintOutput.ControlValueChanged, ucrReceiverSelectedVariables.ControlValueChanged, ucrChkOriginalLevel.ControlValueChanged
If Not ucrChkOriginalLevel.Checked Then
If ucrReceiverByFactor.IsEmpty AndAlso Not ucrReceiverSelectedVariables.IsEmpty Then
clsDefaultFunction.AddParameter("store_results", "FALSE", iPosition:=3)
clsDefaultFunction.AddParameter("return_output", "TRUE", iPosition:=4)
ucrBase.clsRsyntax.iCallType = 2
Else
clsDefaultFunction.RemoveParameterByName("return_output")
If ucrChkStoreResults.Checked Then
clsDefaultFunction.AddParameter("store_results", "TRUE", iPosition:=3)
Else
clsDefaultFunction.AddParameter("store_results", "FALSE", iPosition:=3)
End If
If ucrChkPrintOutput.Checked Then
clsDefaultFunction.AddParameter("return_output", "TRUE", iPosition:=4)
Else
clsDefaultFunction.AddParameter("return_output", "FALSE", iPosition:=4)
End If
End If
Else
If ucrChkPrintOutput.Checked Then
clsDefaultFunction.AddParameter("return_output", "TRUE", iPosition:=4)
Else
clsDefaultFunction.RemoveParameterByName("return_output")
End If
clsDefaultFunction.AddParameter("store_results", "TRUE", iPosition:=3)
End If
End Sub

Expand Down
11 changes: 10 additions & 1 deletion instat/dlgDescribeTwoVariable.Designer.vb

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion instat/dlgDisplayDailyData.vb
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ Public Class dlgDisplayDailyData
ucrChkIQR.SetParameter(New RParameter("IQR", 5), bNewChangeParameterValue:=True, bNewAddRemoveParameter:=True, strNewValueIfChecked:=Chr(34) & "IQR" & Chr(34), strNewValueIfUnchecked:=Chr(34) & Chr(34))
ucrChkIQR.SetText("IQR")

ucrChkSumMissing.SetParameter(New RParameter("summary_count_missing", 6), bNewChangeParameterValue:=True, bNewAddRemoveParameter:=True, strNewValueIfChecked:=Chr(34) & "summary_count_missing" & Chr(34), strNewValueIfUnchecked:=Chr(34) & Chr(34))
ucrChkSumMissing.SetParameter(New RParameter("summary_count_miss", 6), bNewChangeParameterValue:=True, bNewAddRemoveParameter:=True, strNewValueIfChecked:=Chr(34) & "summary_count_miss" & Chr(34), strNewValueIfUnchecked:=Chr(34) & Chr(34))
ucrChkSumMissing.SetText("N Missing")

ucrNudNumberOfColumns.SetParameter(New RParameter("ncol", 1))
Expand Down
2 changes: 1 addition & 1 deletion instat/dlgExtremesClimatic.vb
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,7 @@ Public Class dlgExtremesClimatic
clsNSummary.AddParameter("save", "2", iPosition:=4)
clsNSummary.SetAssignTo("n_dates_summary")

clsNFunction.SetRCommand("summary_count")
clsNFunction.SetRCommand("summary_count_all")
clsNFunction.bToScriptAsRString = True

clsFilterExtremeCalc.SetRCommand("instat_calculation$new")
Expand Down
2 changes: 1 addition & 1 deletion instat/dlgLabelsLevels.vb
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ Public Class dlgLabelsLevels
ucrSelectorForLabels.Focus()


clsSumCountMissingFunction.SetRCommand("summary_count_missing")
clsSumCountMissingFunction.SetRCommand("summary_count_miss")

clsViewLabelsFunction.SetRCommand(frmMain.clsRLink.strInstatDataObject & "$set_factor_levels")
ucrBase.clsRsyntax.SetBaseRFunction(clsViewLabelsFunction)
Expand Down
2 changes: 1 addition & 1 deletion instat/dlgOneVariableSummarise.vb
Original file line number Diff line number Diff line change
Expand Up @@ -248,8 +248,8 @@ Public Class dlgOneVariableSummarise
strObjectName:="last_table")

clsSummariesList.SetRCommand("c")
clsSummariesList.AddParameter("summary_count_non_missing", Chr(34) & "summary_count_non_missing" & Chr(34), bIncludeArgumentName:=False)
clsSummariesList.AddParameter("summary_count", Chr(34) & "summary_count" & Chr(34), bIncludeArgumentName:=False)
clsSummariesList.AddParameter("summary_count_all", Chr(34) & "summary_count_all" & Chr(34), bIncludeArgumentName:=False)
clsSummariesList.AddParameter("summary_sum", Chr(34) & "summary_sum" & Chr(34), bIncludeArgumentName:=False)

clsSummaryFunction.SetRCommand("summary")
Expand Down
Loading

0 comments on commit 420906c

Please sign in to comment.