Skip to content

Commit

Permalink
Merge pull request #9344 from Vitalis95/twothreevarsum
Browse files Browse the repository at this point in the history
Fixed bug with with ordered factors
  • Loading branch information
N-thony authored Jan 10, 2025
2 parents 2a052d1 + aec89e4 commit d5ddca1
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions instat/dlgDescribeTwoVariable.vb
Original file line number Diff line number Diff line change
Expand Up @@ -1592,7 +1592,7 @@ Public Class dlgDescribeTwoVariable
Dim ucrCurrentReceiver As ucrReceiverSingle = If(rdoTwoVariable.Checked,
ucrReceiverSecondTwoVariableFactor, ucrReceiverThreeVariableSecondFactor)
If Not ucrCurrentReceiver.IsEmpty Then
strSecondVariableType = If({"factor", "character", "logical"}.Contains(ucrCurrentReceiver.strCurrDataType),
strSecondVariableType = If({"factor", "ordered,factor", "character", "logical"}.Contains(ucrCurrentReceiver.strCurrDataType),
"categorical", "numeric")
lblSecondType.Text = strSecondVariableType
lblSecondType.ForeColor = SystemColors.Highlight
Expand Down Expand Up @@ -1653,7 +1653,7 @@ Public Class dlgDescribeTwoVariable
If rdoThreeVariable.Checked Then
Dim ucrCurrentReceiver As ucrReceiverSingle = ucrReceiverThreeVariableThirdVariable
If Not ucrCurrentReceiver.IsEmpty Then
strThirdVariableType = If({"factor", "character", "logical"}.Contains(ucrCurrentReceiver.strCurrDataType),
strThirdVariableType = If({"factor", "ordered,factor", "character", "logical"}.Contains(ucrCurrentReceiver.strCurrDataType),
"categorical", "numeric")
lblThreeVariableCategorical.Text = strThirdVariableType
lblThreeVariableCategorical.ForeColor = SystemColors.Highlight
Expand Down
2 changes: 1 addition & 1 deletion instat/dlgOneVariableSummarise.vb
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ Public Class dlgOneVariableSummarise
ucrChkOmitMissing.AddAdditionalCodeParameterPair(clsSummaryTableFunction, New RParameter("na.rm", iNewPosition:=2), iAdditionalPairNo:=1)
ucrSaveSummary.AddAdditionalRCode(clsSummaryFunction, iAdditionalPairNo:=1)
ucrSaveSummary.AddAdditionalRCode(clsJoiningPipeOperator, iAdditionalPairNo:=2)
ucrReceiverOneVarSummarise.SetRCode(clsSummaryFunction, bReset)
ucrReceiverOneVarSummarise.AddAdditionalCodeParameterPair(clsSummaryFunction, New RParameter("object", iNewPosition:=2), iAdditionalPairNo:=1)
ucrChkOmitMissing.SetRCode(clsSummaryFunction, bReset)

ucrPnlSummaries.SetRCode(clsDummyFunction, bReset)
Expand Down
2 changes: 1 addition & 1 deletion instat/dlgReplaceValues.vb
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ Public Class dlgReplaceValues
ucrReceiverReplace.SetParameter(New RParameter("col_names", 1))
ucrReceiverReplace.Selector = ucrSelectorReplace
ucrReceiverReplace.SetMeAsReceiver()
ucrReceiverReplace.SetSingleTypeStatus(True)
ucrReceiverReplace.SetSingleTypeStatus(True, bIsCategoricalNumeric:=True)
ucrReceiverReplace.SetParameterIsString()

'Old Values
Expand Down
2 changes: 1 addition & 1 deletion instat/ucrReceiverMultiple.vb
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,7 @@ Public Class ucrReceiverMultiple
If bIsCategoricalNumeric Then
' logical can be considered as both categorical or numeric so should be dealt with on individual dialogs
For i As Integer = 0 To strDataTypes.Count - 1
If strDataTypes(i).Contains("factor") OrElse strDataTypes(i).Contains("character") Then
If strDataTypes(i).Contains("factor") OrElse strDataTypes(i).Contains("character") OrElse strDataTypes(i).Contains("ordered") Then
strDataTypes(i) = "categorical"
ElseIf Not strDataTypes(i).Contains("logical") Then
strDataTypes(i) = "numeric"
Expand Down

0 comments on commit d5ddca1

Please sign in to comment.