Skip to content

Commit

Permalink
Merge pull request #64 from africanmathsinitiative/master
Browse files Browse the repository at this point in the history
merge from main
  • Loading branch information
dannyparsons committed Feb 19, 2016
2 parents 755d190 + b75d34c commit c230d35
Show file tree
Hide file tree
Showing 18 changed files with 490 additions and 101 deletions.
23 changes: 22 additions & 1 deletion instat/dlgDeleteSheet.Designer.vb

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

27 changes: 26 additions & 1 deletion instat/dlgDeleteSheet.vb
Original file line number Diff line number Diff line change
@@ -1,3 +1,28 @@
Public Class dlgDeleteSheet
' Instat-R
' Copyright (C) 2015
'
' This program is free software: you can redistribute it and/or modify
' it under the terms of the GNU General Public License as published by
' the Free Software Foundation, either version 3 of the License, or
' (at your option) any later version.
'
' This program is distributed in the hope that it will be useful,
' but WITHOUT ANY WARRANTY; without even the implied warranty of
' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
' GNU General Public License for more details.
'
' You should have received a copy of the GNU General Public License k
' along with this program. If not, see <http://www.gnu.org/licenses/>.
Imports instat.Translations
Public Class dlgDeleteSheet
Private Sub dlgDeleteSheet_Load(sender As Object, e As EventArgs) Handles Me.Load
'set the function
ucrBase.clsRsyntax.SetFunction(frmMain.clsRLink.strInstatDataObject & "$delete_dataframe")
ucrDataFrameToDelete.Focus()
autoTranslate(Me)
End Sub

Private Sub ucrDataFrameToDelete_Leave(sender As Object, e As EventArgs) Handles ucrDataFrameToDelete.Leave
ucrBase.clsRsyntax.AddParameter("data_name", Chr(34) & ucrDataFrameToDelete.cboAvailableDataFrames.SelectedItem & Chr(34))
End Sub
End Class
47 changes: 26 additions & 21 deletions instat/dlgPermuteRows.Designer.vb

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

29 changes: 25 additions & 4 deletions instat/dlgPermuteRows.vb
Original file line number Diff line number Diff line change
Expand Up @@ -16,23 +16,44 @@

Imports instat.Translations
Public Class dlgPermuteRows
Public clsSetSampleFunc As New RFunction
Public clsSetSeedFunc As New RFunction
Private Sub dlgPermuteRows_Load(sender As Object, e As EventArgs) Handles MyBase.Load
autoTranslate(Me)
ucrReceiverPermuteRows.Selector = ucrSelectorDataFrameAddRemove
ucrReceiverPermuteRows.SetMeAsReceiver()
ucrSelectorNewColumnName.SetDataFrameSelector(ucrSelectorDataFrameAddRemove.ucrAvailableDataFrames)
ucrSelectorNewColumnName.SetPrefix("Perm")
txtSetSeed.Visible = False
clsSetSeedFunc.SetRCommand("set.seed")

ucrBase.clsRsyntax.SetFunction("replicate")
ucrBase.clsRsyntax.AddParameter("expr", clsRFunctionParameter:=clsSetSampleFunc)
clsSetSampleFunc.SetRCommand("sample")

clsSetSampleFunc.AddParameter("x", clsRFunctionParameter:=ucrReceiverPermuteRows.GetVariables())
clsSetSampleFunc.AddParameter("replace", "FALSE")
clsSetSampleFunc.AddParameter("size", ucrSelectorDataFrameAddRemove.ucrAvailableDataFrames.iDataFrameLength)
nudSetSeed.Visible = False
ucrBase.clsRsyntax.SetAssignTo(strAssignToName:=ucrSelectorNewColumnName.cboColumnName.Text, strTempDataframe:=ucrSelectorDataFrameAddRemove.ucrAvailableDataFrames.cboAvailableDataFrames.Text, strTempColumn:=ucrSelectorNewColumnName.cboColumnName.Text)
End Sub
Private Sub ucrReceiverPermuteRows_Leave(sender As Object, e As EventArgs) Handles ucrReceiverPermuteRows.Leave
clsSetSampleFunc.AddParameter("x", clsRFunctionParameter:=ucrReceiverPermuteRows.GetVariables())

End Sub
Private Sub chkSetSeed_CheckedChanged(sender As Object, e As EventArgs) Handles chkSetSeed.CheckedChanged
If chkSetSeed.Checked = True Then
txtSetSeed.Visible = True
nudSetSeed.Visible = True
Else
txtSetSeed.Visible = False
nudSetSeed.Visible = False
End If
End Sub


End If
Private Sub nudSetSeed_Leave(sender As Object, e As EventArgs) Handles nudSetSeed.Leave
clsSetSeedFunc.AddParameter("seed", nudSetSeed.Text)
End Sub

Private Sub nudNumberOfPerColumns_Leave(sender As Object, e As EventArgs) Handles nudNumberOfPerColumns.Leave
ucrBase.clsRsyntax.AddParameter("n", nudNumberOfPerColumns.Text)
End Sub
End Class
47 changes: 46 additions & 1 deletion instat/dlgRenameSheet.Designer.vb

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

33 changes: 32 additions & 1 deletion instat/dlgRenameSheet.vb
Original file line number Diff line number Diff line change
@@ -1,3 +1,34 @@
Public Class dlgRenameSheet
' Instat-R
' Copyright (C) 2015
'
' This program is free software: you can redistribute it and/or modify
' it under the terms of the GNU General Public License as published by
' the Free Software Foundation, either version 3 of the License, or
' (at your option) any later version.
'
' This program is distributed in the hope that it will be useful,
' but WITHOUT ANY WARRANTY; without even the implied warranty of
' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
' GNU General Public License for more details.
'
' You should have received a copy of the GNU General Public License k
' along with this program. If not, see <http://www.gnu.org/licenses/>.

Imports instat.Translations
Public Class dlgRenameSheet
Private Sub dlgRenameSheet_Load(sender As Object, e As EventArgs) Handles Me.Load
autoTranslate(Me)
'set the function
ucrBase.clsRsyntax.SetFunction(frmMain.clsRLink.strInstatDataObject & "$rename_dataframe")
End Sub

Private Sub txtNewName_Leave(sender As Object, e As EventArgs) Handles txtNewName.Leave
If txtNewName.Text <> "" Then
ucrBase.clsRsyntax.AddParameter("new_value", Chr(34) & txtNewName.Text & Chr(34))
End If
End Sub

Private Sub ucrDataFrameToRename_Leave(sender As Object, e As EventArgs) Handles ucrDataFrameToRename.Leave
ucrBase.clsRsyntax.AddParameter("data_name", Chr(34) & ucrDataFrameToRename.cboAvailableDataFrames.SelectedItem & Chr(34))
End Sub
End Class
11 changes: 8 additions & 3 deletions instat/dlgRowStats.vb
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,13 @@ Public Class dlgRowStats
Private Sub dlgRowStats_Load(sender As Object, e As EventArgs) Handles MyBase.Load
autoTranslate(Me)
ucrBase.clsRsyntax.SetFunction("apply")
ucrBase.clsRsyntax.iCallType = 1
ucrBase.clsRsyntax.iCallType = 0
ucrReceiverRowStatistics.Selector = ucrSelectorByDataFrameAddRemove
ucrReceiverRowStatistics.SetMeAsReceiver()
ucrBase.clsRsyntax.AddParameter("MARGIN", 1)
ucrNewColumnNameSelector.SetDataFrameSelector(ucrSelectorByDataFrameAddRemove.ucrAvailableDataFrames)
ucrNewColumnNameSelector.SetPrefix("Row_Summary")
ucrBase.clsRsyntax.SetAssignTo(strAssignToName:=ucrNewColumnNameSelector.cboColumnName.Text, strTempDataframe:=ucrSelectorByDataFrameAddRemove.ucrAvailableDataFrames.cboAvailableDataFrames.Text, strTempColumn:=ucrNewColumnNameSelector.cboColumnName.Text)

End Sub

Private Sub ucrReceiverRowStatistics_Leave(sender As Object, e As EventArgs) Handles ucrReceiverRowStatistics.Leave
Expand All @@ -40,7 +39,7 @@ Public Class dlgRowStats
If rdoMean.Checked = True Then
ucrBase.clsRsyntax.AddParameter("FUN", "mean")
ElseIf rdoCount.Checked = True Then
ucrBase.clsRsyntax.AddParameter("FUN", "count")
ucrBase.clsRsyntax.AddParameter("FUN", "function(z) sum(!is.na(z))")
ElseIf rdoMaximum.Checked = True Then
ucrBase.clsRsyntax.AddParameter("FUN", "max")
ElseIf rdoMinimum.Checked = True Then
Expand All @@ -49,7 +48,13 @@ Public Class dlgRowStats
ucrBase.clsRsyntax.AddParameter("FUN", "sum")
ElseIf rdoStandardDeviation.Checked = True Then
ucrBase.clsRsyntax.AddParameter("FUN", "sd")
Else
ucrBase.clsRsyntax.RemoveParameter("FUN")
End If

End Sub

Private Sub ucrNewColumnNameSelector_Leave(sender As Object, e As EventArgs) Handles ucrNewColumnNameSelector.Leave
ucrBase.clsRsyntax.SetAssignTo(strAssignToName:=ucrNewColumnNameSelector.cboColumnName.Text, strTempDataframe:=ucrSelectorByDataFrameAddRemove.ucrAvailableDataFrames.cboAvailableDataFrames.Text, strTempColumn:=ucrNewColumnNameSelector.cboColumnName.Text)
End Sub
End Class
Loading

0 comments on commit c230d35

Please sign in to comment.