Skip to content

Commit

Permalink
Merge pull request #50 from africanmathsinitiative/master
Browse files Browse the repository at this point in the history
Updating Master
  • Loading branch information
EstherNjeriLiberatta authored May 19, 2022
2 parents 1e6d853 + 2309005 commit bd00a86
Show file tree
Hide file tree
Showing 7 changed files with 98 additions and 76 deletions.
6 changes: 3 additions & 3 deletions docs/Download.html
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,11 @@
<div class="row">
<div class="col-lg-8 col-lg-offset-2 text-center">
<h2 class="section-heading">Download R-Instat</h2>
<p><strong>In response to the recent <a href=https://r4stats.com/articles/software-reviews/r-instat/ style="color:blue;" target="_blank">review of R-Instat</a> by Bob Muenchen we have released a new version of R-Instat, version 0.7.4, which includes some new features and initial improvements from the review. Many thanks to Bob for reviewing R-Instat.</strong></p>
<p><strong>In response to the recent <a href=https://r4stats.com/articles/software-reviews/r-instat/ style="color:blue;" target="_blank">review of R-Instat</a> by Bob Muenchen we have released a new version of R-Instat, version 0.7.5, which includes some new features and initial improvements from the review. Many thanks to Bob for reviewing R-Instat.</strong></p>
<hr class="light">
<p><a href=https://downloads.r-instat.org/R-Instat_0.7.4_Installer_32.exe style="color:blue;" target="_blank">R-Instat 0.7.4 Installer 32 Bit (.exe 734MB)</a></p>
<p><a href=https://downloads.r-instat.org/R-Instat_0.7.5_Installer_32.exe style="color:blue;" target="_blank">R-Instat 0.7.5 Installer 32 Bit (.exe 734MB)</a></p>
<p>If you know that you have a 64 bit computer, we suggest you download the 64 Bit version</p>
<a href=https://downloads.r-instat.org/R-Instat_0.7.4_Installer_64.exe style="color:blue;" target="_blank">R-Instat 0.7.4 Installer 64 Bit (.exe 736MB)</a>
<a href=https://downloads.r-instat.org/R-Instat_0.7.5_Installer_64.exe style="color:blue;" target="_blank">R-Instat 0.7.5 Installer 64 Bit (.exe 736MB)</a>
<p>R-Instat is currently a Windows only application. However, it can be accessed on Mac or Linux through use of a Virtual Windows Machine.</p>

<h2 class="section-heading">Installation & Documentation</h2>
Expand Down
18 changes: 9 additions & 9 deletions instat/dlgMergeAdditionalData.vb
Original file line number Diff line number Diff line change
Expand Up @@ -158,12 +158,12 @@ Public Class dlgMergeAdditionalData
End Sub

Private Sub SetMergingBy()
Dim lstJoiningColumns As New List(Of String)
Dim dctJoinColumns As New Dictionary(Of String, String)
lstJoinColumns.Clear()
If ucrFromDataFrame.ucrAvailableDataFrames.cboAvailableDataFrames.Text <> "" AndAlso ucrToDataFrame.cboAvailableDataFrames.Text <> "" Then
If clsLeftJoinFunction.ContainsParameter("by") Then
For Each clsTempParam As RParameter In clsByListFunction.clsParameters
lstJoiningColumns.Add(clsTempParam.strArgumentName.Trim(Chr(34)))
dctJoinColumns.Add(clsTempParam.strArgumentName.Trim(Chr(34)), clsTempParam.strArgumentValue.Trim(Chr(34)))
Next
Else
Dim lstFirstColumns As List(Of String)
Expand All @@ -173,7 +173,7 @@ Public Class dlgMergeAdditionalData
Dim i As Integer = 0
For Each strFirst As String In lstFirstColumns
If lstSecondColumns.Contains(strFirst) Then
lstJoiningColumns.Add(strFirst)
dctJoinColumns.Add(strFirst, strFirst)
clsByListFunction.AddParameter(Chr(34) & strFirst & Chr(34), Chr(34) & strFirst & Chr(34), iPosition:=i)
i += 1
End If
Expand All @@ -182,11 +182,11 @@ Public Class dlgMergeAdditionalData
clsLeftJoinFunction.AddParameter("by", clsRFunctionParameter:=clsByListFunction, iPosition:=2)
End If
End If
If lstJoiningColumns.Count > 0 Then
If dctJoinColumns.Count > 0 Then
Dim lstJoinPairs As New List(Of String)
For Each kvpTemp As String In lstJoiningColumns
lstJoinPairs.Add(kvpTemp & " = " & kvpTemp)
lstJoinColumns.Add(kvpTemp)
For Each kvpTemp As KeyValuePair(Of String, String) In dctJoinColumns
lstJoinPairs.Add(kvpTemp.Key & " = " & kvpTemp.Value)
lstJoinColumns.Add(kvpTemp.Value)
Next
ucrInputMergingBy.SetName(String.Join(", ", lstJoinPairs))
ucrInputMergingBy.txtInput.BackColor = SystemColors.Control
Expand All @@ -203,7 +203,7 @@ Public Class dlgMergeAdditionalData
clsLeftJoinFunction.RemoveParameterByName("by")
clsByListFunction.ClearParameters()
End If
bBySpecified = (lstJoiningColumns.Count > 0)
bBySpecified = (dctJoinColumns.Count > 0)
TestOkEnabled()
End Sub

Expand Down Expand Up @@ -236,7 +236,7 @@ Public Class dlgMergeAdditionalData
Dim clsAnyDuplicatesFunction As New RFunction
Dim iAnyDuplicated As Integer

If ucrInputMergingBy.GetText <> "" Then
If ucrInputMergingBy.GetText <> "" AndAlso lstJoinColumns.Count > 0 Then
clsGetVariablesFunction.AddParameter("col_names", frmMain.clsRLink.GetListAsRString(lstJoinColumns, bWithQuotes:=True), iPosition:=1)
clsAnyDuplicatesFunction.SetRCommand("anyDuplicated")
clsAnyDuplicatesFunction.AddParameter("x", clsRFunctionParameter:=clsGetVariablesFunction)
Expand Down
4 changes: 3 additions & 1 deletion instat/dlgRowSummary.vb
Original file line number Diff line number Diff line change
Expand Up @@ -573,8 +573,10 @@ Public Class dlgRowSummary
Private Sub AddConcatenateParameters()
clsConcatenateFunction.ClearParameters()
If rdoRowRanks.Checked Then
Dim iPosition As Integer = 0
For Each strVariable In ucrReceiverForRowSummaries.GetVariableNamesAsList
clsConcatenateFunction.AddParameter(strVariable, Chr(34) & strVariable & "_r" & Chr(34), bIncludeArgumentName:=False, iPosition:=0)
clsConcatenateFunction.AddParameter(strVariable, Chr(34) & strVariable & "_r" & Chr(34), bIncludeArgumentName:=False, iPosition:=iPosition)
iPosition += 1
Next
ElseIf rdoRowRange.Checked Then
clsConcatenateFunction.AddParameter("r_min", Chr(34) & "r_min" & Chr(34), bIncludeArgumentName:=False, iPosition:=0)
Expand Down
78 changes: 42 additions & 36 deletions instat/dlgTransposeColumns.vb
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,9 @@ Imports instat.Translations
Public Class dlgTransposeColumns
Private bFirstLoad As Boolean = True
Private bReset As Boolean = True
Private bResettingDialogue As Boolean = False
Private clsOverallFunction, clsTransposeFunction, clsGetColumnNamesFunction As New RFunction
Private lstVariables As New List(Of String)
Private lstEditedVariables, lstAllVariables As New List(Of String)
Private Sub dlgTransposeColumns_Load(sender As Object, e As EventArgs) Handles MyBase.Load
If bFirstLoad Then
InitialiseDialog()
Expand Down Expand Up @@ -67,7 +68,6 @@ Public Class dlgTransposeColumns
clsTransposeFunction.SetPackageName("data.table")
clsTransposeFunction.SetRCommand("transpose")
clsTransposeFunction.AddParameter("l", "columns", iPosition:=0)
clsTransposeFunction.AddParameter("make.names", "NULL", iPosition:=1)
ucrBase.clsRsyntax.SetBaseRFunction(clsOverallFunction)
End Sub
Private Sub SetRCodeforControls(bReset As Boolean)
Expand All @@ -89,9 +89,12 @@ Public Class dlgTransposeColumns
End If
End Sub
Private Sub ucrBase_ClickReset(sender As Object, e As EventArgs) Handles ucrBase.ClickReset
bResettingDialogue = True
SetDefaults()
SetRCodeforControls(True)
UpdateSelector()
TestOkEnabled()
bResettingDialogue = False
End Sub
Private Sub NewDefaultName()
If (Not ucrNewDataframe.bUserTyped) AndAlso ucrSelectorTransposeColumns.ucrAvailableDataFrames.cboAvailableDataFrames.Text <> "" Then
Expand All @@ -106,36 +109,37 @@ Public Class dlgTransposeColumns
clsGetColumnNamesFunction = ucrReceiverColumnsToTranspose.GetVariables(True).Clone
clsGetColumnNamesFunction.SetAssignTo("columns")
ucrBase.clsRsyntax.AddToBeforeCodes(clsGetColumnNamesFunction)
If ucrReceiverColumnsToTranspose.IsEmpty AndAlso lstVariables.Count > 0 Then
If ucrReceiverColumnsToTranspose.IsEmpty AndAlso lstEditedVariables.Count > 0 Then
UpdateSelector()
ucrReceiverColumnsToTranspose.SetMeAsReceiver()
End If
If ucrReceiverColumnsToTranspose.IsEmpty Then
ucrReceiverVariableNames.Clear()
End If
End Sub

Private Sub UpdateSelector()
ClearSelector()
For i = 0 To lstVariables.Count - 1
ucrSelectorTransposeColumns.lstAvailableVariable.Items.Add(lstVariables.Item(i))
ucrSelectorTransposeColumns.lstAvailableVariable.Items(i).Tag = ucrSelectorTransposeColumns.ucrAvailableDataFrames.cboAvailableDataFrames.Text
Next
End Sub

Private Sub CoreControls_ControlContentsChanged(ucrChangedControl As ucrCore) Handles ucrReceiverColumnsToTranspose.ControlContentsChanged,
ucrNewDataframe.ControlContentsChanged, ucrReceiverVariableNames.ControlContentsChanged, ucrChkDisplayVariableNames.ControlContentsChanged,
ucrInputDisplayVariableNames.ControlContentsChanged
TestOkEnabled()
If bResettingDialogue Then
For i = 0 To lstAllVariables.Count - 1
ucrSelectorTransposeColumns.lstAvailableVariable.Items.Add(lstAllVariables.Item(i))
ucrSelectorTransposeColumns.lstAvailableVariable.Items(i).Tag = ucrSelectorTransposeColumns.ucrAvailableDataFrames.cboAvailableDataFrames.Text
Next
Else
For i = 0 To lstEditedVariables.Count - 1
ucrSelectorTransposeColumns.lstAvailableVariable.Items.Add(lstEditedVariables.Item(i))
ucrSelectorTransposeColumns.lstAvailableVariable.Items(i).Tag = ucrSelectorTransposeColumns.ucrAvailableDataFrames.cboAvailableDataFrames.Text
Next
End If
End Sub

Private Sub ClearSelector()
ucrSelectorTransposeColumns.lstAvailableVariable.Clear()
ucrSelectorTransposeColumns.lstAvailableVariable.Groups.Clear()
ucrSelectorTransposeColumns.lstAvailableVariable.Columns.Add("Variables")
End Sub

Private Sub ucrReceiverVariableNames_Enter(sender As Object, e As EventArgs) Handles ucrReceiverVariableNames.Enter
Dim grps As New ListViewGroup
ClearSelector()
If Not ucrReceiverColumnsToTranspose.IsEmpty Then
ClearSelector()
If ucrReceiverColumnsToTranspose.GetVariableNamesList(False).Count > 1 Then
grps = New ListViewGroup(key:=ucrSelectorTransposeColumns.ucrAvailableDataFrames.cboAvailableDataFrames.Text,
headerText:=ucrSelectorTransposeColumns.ucrAvailableDataFrames.cboAvailableDataFrames.Text)
Expand All @@ -148,28 +152,30 @@ Public Class dlgTransposeColumns
Next
End If
End Sub

Private Sub ucrSelectorTransposeColumns_DataFrameChanged() Handles ucrSelectorTransposeColumns.DataFrameChanged
If ucrSelectorTransposeColumns.lstAvailableVariable.Items.Count > 0 Then
lstVariables.Clear()
For Each lstv As ListViewItem In ucrSelectorTransposeColumns.lstAvailableVariable.Items
lstVariables.Add(lstv.Text)
Next
End If
End Sub

Private Sub ucrReceiverVariableNames_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrReceiverVariableNames.ControlValueChanged
ResetSelector()
End Sub

Private Sub ResetSelector()
If ucrReceiverVariableNames.IsEmpty AndAlso Not ucrReceiverColumnsToTranspose.IsEmpty _
AndAlso ucrSelectorTransposeColumns.lstAvailableVariable.Items.Count > 0 Then
UpdateSelector()
If Not bResettingDialogue Then
If ucrSelectorTransposeColumns.lstAvailableVariable.Items.Count > 0 Then
lstEditedVariables.Clear()
lstAllVariables.Clear()
For Each lstv As ListViewItem In ucrSelectorTransposeColumns.lstAvailableVariable.Items
lstAllVariables.Add(lstv.Text)
lstEditedVariables.Add(lstv.Text)
Next
End If
End If
End Sub

Private Sub ucrReceiverColumnsToTranspose_Enter(sender As Object, e As EventArgs) Handles ucrReceiverColumnsToTranspose.Enter
ResetSelector()
bResettingDialogue = True
UpdateSelector()
bResettingDialogue = False
'If Not ucrReceiverColumnsToTranspose.IsEmpty AndAlso
' ucrSelectorTransposeColumns.lstAvailableVariable.Items.Count > 0 Then
' UpdateSelector()
'End If
End Sub
Private Sub CoreControls_ControlContentsChanged(ucrChangedControl As ucrCore) Handles ucrReceiverColumnsToTranspose.ControlContentsChanged,
ucrNewDataframe.ControlContentsChanged, ucrReceiverVariableNames.ControlContentsChanged, ucrChkDisplayVariableNames.ControlContentsChanged,
ucrInputDisplayVariableNames.ControlContentsChanged
TestOkEnabled()
End Sub
End Class
Loading

0 comments on commit bd00a86

Please sign in to comment.