Skip to content

Commit

Permalink
Merge pull request #40 from africanmathsinitiative/master
Browse files Browse the repository at this point in the history
merge from main
  • Loading branch information
dannyparsons committed Jan 31, 2016
2 parents 9befecd + 76a5236 commit b303fe1
Show file tree
Hide file tree
Showing 10 changed files with 317 additions and 275 deletions.
38 changes: 24 additions & 14 deletions instat/clsRLink.vb
Original file line number Diff line number Diff line change
Expand Up @@ -63,23 +63,26 @@ Public Class RLink
Dim i As Integer

If bInstatObjectExists Then
lstCurrColumns = clsEngine.Evaluate(strInstatDataObject & "$get_column_names(" & Chr(34) & strDataFrame & Chr(34) & ")").AsList
If cboColumns IsNot Nothing Then
cboColumns.Items.Clear()
For i = 0 To lstCurrColumns.Length - 1
cboColumns.Items.Add(lstCurrColumns.AsCharacter(i))
Next
ElseIf lstColumns IsNot Nothing Then
lstColumns.Items.Clear()
If lstColumns.Columns.Count = 0 Then
lstColumns.Columns.Add("Available Data")
If clsEngine IsNot Nothing Then
lstCurrColumns = clsEngine.Evaluate(strInstatDataObject & "$get_column_names(" & Chr(34) & strDataFrame & Chr(34) & ")").AsList
If cboColumns IsNot Nothing Then
cboColumns.Items.Clear()
For i = 0 To lstCurrColumns.Length - 1
cboColumns.Items.Add(lstCurrColumns.AsCharacter(i))
Next
ElseIf lstColumns IsNot Nothing Then
lstColumns.Items.Clear()
If lstColumns.Columns.Count = 0 Then
lstColumns.Columns.Add("Available Data")
End If
For i = 0 To lstCurrColumns.Length - 1
lstColumns.Items.Add(lstCurrColumns.AsCharacter(i))
Next
lstColumns.Columns(0).Width = -2
End If
For i = 0 To lstCurrColumns.Length - 1
lstColumns.Items.Add(lstCurrColumns.AsCharacter(i))
Next
lstColumns.Columns(0).Width = -2
End If
End If

End Sub

Public Function GetDefaultColumnNames(strPrefix As String)
Expand Down Expand Up @@ -216,4 +219,11 @@ Public Class RLink
End If
End Sub

Public Function GetDataFrameLength(strDataFrameName As String) As Integer
Dim intLength As Integer
If clsEngine IsNot Nothing Then
intLength = clsEngine.Evaluate(frmMain.clsRLink.strInstatDataObject & "$length_of_data(" & Chr(34) & strDataFrameName & Chr(34) & ")").AsInteger(0)
End If
Return intLength
End Function
End Class
2 changes: 1 addition & 1 deletion instat/clsRSyntax.vb
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ Public Class RSyntax
clsRFunction = clsBaseFunction
End If
clsParam.SetArgumentName(strParameterName)
If Not strParameterName = "" Then
If Not strParameterValue = "" Then
clsParam.SetArgumentValue(strParameterValue)
End If
If Not clsRFunctionParameter Is Nothing Then
Expand Down
4 changes: 2 additions & 2 deletions instat/dlgRandomSample.vb
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Public Class dlgRandomSample
' Setting distribution type and base function as distribution function
ucrDistWithParameters.SetRDistributions()
ucrBase.clsRsyntax.clsBaseFunction = ucrDistWithParameters.clsCurrRFunction
ucrDistWithParameters.AddParameter("n", ucrDataFrameSelector.strDataFrameLength)
ucrDistWithParameters.AddParameter("n", ucrDataFrameSelector.iDataFrameLength)

' Setting link between DataFrameSelector and NewColumnNameSelector
' TODO tidy these links up
Expand All @@ -38,7 +38,7 @@ Public Class dlgRandomSample
End Sub

Private Sub ucrDataFrameSelector_Leave(sender As Object, e As EventArgs) Handles ucrDataFrameSelector.Leave
ucrDistWithParameters.AddParameter("n", ucrDataFrameSelector.strDataFrameLength)
ucrDistWithParameters.AddParameter("n", ucrDataFrameSelector.iDataFrameLength)
End Sub

Private Sub ucrNewColumnNameSelector_Leave(sender As Object, e As EventArgs) Handles ucrNewColumnNameSelector.Leave
Expand Down
Loading

0 comments on commit b303fe1

Please sign in to comment.