Skip to content

Commit

Permalink
Merge pull request #92 from africanmathsinitiative/master
Browse files Browse the repository at this point in the history
Updating branch
  • Loading branch information
maxwellfundi authored May 12, 2017
2 parents 4451f9b + 695f156 commit b1d986f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 15 deletions.
11 changes: 6 additions & 5 deletions instat/dlgImportDataset.vb
Original file line number Diff line number Diff line change
Expand Up @@ -331,11 +331,12 @@ Public Class dlgImportDataset
If strFileType <> "RDS" Then
grdDataPreview.Show()
lblDataFrame.Show()
If strFileType = "csv" Then
clsReadCSV.AddParameter("nrows", intLines)
ElseIf strFileType = "xlsx" Then
clsReadXL.AddParameter("rows", "1:" & intLines)
End If
If strFileType = "csv" Then
clsReadCSV.AddParameter("nrows", intLines)
ElseIf strFileType = "xlsx" Then
'iPosition = 0 is needed because of a bug in rio::import
clsReadXL.AddParameter("rows", "1:" & intLines, iPosition:=0)
End If
lblCannotImport.Hide()
lblNoPreview.Hide()
If ucrInputFilePath.IsEmpty() Then
Expand Down
16 changes: 6 additions & 10 deletions instat/dlgUnusedLevels.vb
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,9 @@

Imports instat.Translations
Public Class dlgUnusedLevels
Public bFirstLoad As Boolean = True
Private bFirstLoad As Boolean = True
Private bReset As Boolean = True
Private clsUnusedLevels As New RFunction

Private Sub dlgUnusedLevels_Load(sender As Object, e As EventArgs) Handles MyBase.Load
If bFirstLoad Then
Expand All @@ -31,25 +32,19 @@ Public Class dlgUnusedLevels
bReset = False
autoTranslate(Me)
End Sub
Private Sub ReopenDialog()

End Sub
Private Sub SetDefaults()
Dim clsDefaultFunction As New RFunction

clsUnusedLevels = New RFunction
ucrSelectorFactorColumn.Reset()

' Set default RFunction as the base function
clsDefaultFunction.SetRCommand(frmMain.clsRLink.strInstatDataObject & "$drop_unused_factor_levels")
ucrBase.clsRsyntax.SetBaseRFunction(clsDefaultFunction.Clone())

clsUnusedLevels.SetRCommand(frmMain.clsRLink.strInstatDataObject & "$drop_unused_factor_levels")
ucrBase.clsRsyntax.SetBaseRFunction(clsUnusedLevels)
End Sub

Private Sub SetRCodeforControls(bReset As Boolean)
SetRCode(Me, ucrBase.clsRsyntax.clsBaseFunction, bReset)
End Sub


Private Sub InitialiseDialog()
ucrBase.iHelpTopicID = 40

Expand All @@ -58,6 +53,7 @@ Public Class dlgUnusedLevels
ucrReceiverFactorColumn.SetMeAsReceiver()
ucrReceiverFactorColumn.SetIncludedDataTypes({"factor"})
ucrRemoveUnusedFactorLevels.SetReceiver(ucrReceiverFactorColumn)

ucrReceiverFactorColumn.SetParameter(New RParameter("col_name", 1))
ucrReceiverFactorColumn.SetParameterIsString()

Expand Down

0 comments on commit b1d986f

Please sign in to comment.