def __init__(self, parent=None, signalManager=None): OWRpy.__init__(self) self.RFunctionParam_height = '' self.inputs.addInput("height", "Plotting Vector", signals.RList.RList, self.processheight) self.RFunctionParammain_lineEdit = redRlineEdit(self.controlArea, label = "main:", text = '') self.RFunctionParamhoriz_lineEdit = redRlineEdit(self.controlArea, label = "horiz:", text = '') self.namesBox = redRcomboBox(self.controlArea, label = 'Data Element:', callback = self.commitFunction) self.RFunctionParamspace_lineEdit = redRSpinBox(self.controlArea, label = "Space:", min = 0, max = 99, value = 5) self.RFunctionParamxlab_lineEdit = redRlineEdit(self.controlArea, label = "xlab:", text = '') self.plotArea = redRgraphicsView(self.controlArea,label='Bar Plot', displayLabel=False) self.commit = redRCommitButton(self.bottomAreaRight, "Commit", callback = self.commitFunction, processOnInput=True)
def __init__(self, parent=None, signalManager=None): OWRpy.__init__(self) self.data = {} self.setRvariableNames(['acomp', 'rcomp', 'aplus', 'rplus']) self.RFunctionParam_X = '' self.inputs.addInput("X", "X", signals.RDataFrame.RDataFrame, self.processX) self.outputs.addOutput("acomp Output","acomp Output", signals.RMatrix.RMatrix) self.outputs.addOutput("rcomp Output","rcomp Output", signals.RMatrix.RMatrix) self.outputs.addOutput("rplus Output","rplus Output", signals.RMatrix.RMatrix) self.outputs.addOutput("aplus Output","aplus Output", signals.RMatrix.RMatrix) self.compositionType = redRradioButtons(self.controlArea, label = "Composition Type:", buttons = ['acomp', 'rcomp', 'aplus', 'rplus'], setChecked = "acomp", orientation='horizontal') # choose composition type self.RFunctionParamparts_lineEdit = redRlineEdit(self.controlArea, label = "parts:", text = '') self.RFunctionParamtotal_lineEdit = redRlineEdit(self.controlArea, label = "total:", text = '1') redRCommitButton(self.bottomAreaRight, "Commit", callback = self.commitFunction)
def __init__(self, parent=None, signalManager=None): OWRpy.__init__(self) self.setRvariableNames(["rbind"]) self.data = {} self.RFunctionParam_x = '' self.inputs.addInput( "x", _("Data"), [signals.RDataFrame.RDataFrame, signals.RVector.RVector], self.processx, multiple=True) self.outputs.addOutput("rbind Output", _("Joined Data"), signals.RDataFrame.RDataFrame) self.rowcolnames = redRcomboBox( self.controlArea, label=_('Source of Row / Column Names:'), callback=self.commitFunction) self.bindingMode = redRRadioButtons(self.controlArea, label=_('Binding Mode:'), buttons=[_('Row'), _('Column')], setChecked=_('Row')) self.RFunctionParamdeparse_level_lineEdit = redRlineEdit( self.controlArea, label=_("Deparse Level:"), text='1') redRCommitButton(self.bottomAreaRight, _("Commit"), callback=self.commitFunction)
def __init__(self, parent=None, signalManager=None): OWRpy.__init__(self) self.data = {} self.setRvariableNames(['acomp', 'rcomp', 'aplus', 'rplus']) self.RFunctionParam_X = '' self.inputs.addInput("X", "X", signals.RDataFrame.RDataFrame, self.processX) self.outputs.addOutput("acomp Output","acomp Output", signals.RMatrix.RMatrix) self.outputs.addOutput("rcomp Output","rcomp Output", signals.RMatrix.RMatrix) self.outputs.addOutput("rplus Output","rplus Output", signals.RMatrix.RMatrix) self.outputs.addOutput("aplus Output","aplus Output", signals.RMatrix.RMatrix) self.compositionType = redRradioButtons(self.controlArea, label = "Composition Type:", buttons = ['acomp', 'rcomp', 'aplus', 'rplus'], setChecked = "acomp", orientation='horizontal') # choose composition type self.RFunctionParamparts_lineEdit = redRlineEdit(self.controlArea, label = "parts:", text = '') self.RFunctionParamtotal_lineEdit = redRlineEdit(self.controlArea, label = "total:", text = '1') redRCommitButton(self.bottomAreaRight, "Commit", callback = self.commitFunction)
def __init__(self, parent=None, signalManager=None): OWRpy.__init__(self) self.require_librarys(["caret"]) self.setRvariableNames(["train", 'tempData']) self.data = {} self.RFunctionParam_data = '' self.inputs.addInput("data", "data", [ signals.RArbitraryList.RArbitraryList, signals.RDataFrame.RDataFrame ], self.processdata) self.outputs.addOutput("train Output", "train Output", signals.RModelFit.RModelFit) self.trainingData = redRcomboBox(self.controlArea, label='Training Data:') self.RFunctionParamcustomArgs_lineEdit = redRlineEdit( self.controlArea, label="customArgs:", text='') #self.RFunctionParamtrControl_lineEdit = redRlineEdit(self.controlArea, label = "trControl:", text = '') self.RFunctionParammethod_comboBox = redRcomboBox( self.controlArea, label="Method:", items=[ "ada", "bagEarth", "bagFDA", "blackboost", "cforest", "ctree", "ctree2", "earth", "enet", "fda", "gamboost", "gaussprPoly", "gaussprRadial", "gaussprLinear", "gbm", "glm", "glmboost", "glmnet", "gpls", "J48", "JRip", "knn", "lars", "lasso", "lda", "Linda", "lm", "lmStepAIC", "LMT", "logitBoost", "lssvmPoly", "lssvmRadial", "lvq", "M5Rules", "mda", "multinom", "nb", "nnet", "nodeHarvest", "OneR", "pam", "pcaNNet", "pcr", "pda", "pda2", "penalized", "pls", "ppr", "qda", "QdaCov", "rda", "rf", "rlm", "rpart", "rvmLinear", "rvmPoly", "rvmRadial", "sda", "sddaLDA", "sddaQDA", "slda", "smda", "sparseLDA", "spls", "stepLDA", "stepQDA", "superpc", "svmPoly", "svmRadial", "svmLinear", "treebag", "vbmpRadial" ]) #self.formula = redRRFormulaEntry(self.controlArea) self.resultVariable = redRcomboBox(self.controlArea, label='Class Data:') self.RFunctionParamform_lineEdit = redRlineEdit(self.controlArea, label="form:", text='') self.RoutputWindow = redRtextEdit(self.controlArea, label="R Output Window") redRCommitButton(self.bottomAreaRight, "Commit", callback=self.commitFunction)
def __init__(self, parent=None, signalManager=None): OWRpy.__init__(self) self.RFunctionParam_x = '' self.inputs.addInput("x", "x", signals.RDataFrame.RDataFrame, self.processx) self.RFunctionParammain_lineEdit = redRlineEdit(self.controlArea, label="Main Title:", text='') self.RFunctionParamxlab_lineEdit = redRlineEdit(self.controlArea, label="X label:", text='') self.RFunctionParamylab_lineEdit = redRlineEdit(self.controlArea, label="Y label:", text='') self.plotArea = redRgraphicsView(self.controlArea) redRCommitButton(self.bottomAreaRight, "Commit", callback=self.commitFunction)
def __init__(self, parent=None, signalManager=None): OWRpy.__init__(self) self.setRvariableNames(["t.test"]) self.data = {} self.RFunctionParam_y = '' self.RFunctionParam_x = '' self.inputs.addInput("y", "y", signals.RVector.RVector, self.processy) self.inputs.addInput("x", "x", signals.RVector.RVector, self.processx) self.outputs.addOutput("t.test Output", "t.test Output", signals.RModelFit.RModelFit) self.RFunctionParampaired_radioButtons = redRradioButtons( self.controlArea, label="paired:", buttons=["TRUE", "FALSE"], setChecked="FALSE", orientation='horizontal') self.RFunctionParamalternative_checkBox = redRradioButtons( self.controlArea, label="alternative:", buttons=["two.sided", "less", "greater"], setChecked="two.sided", orientation='horizontal') self.RFunctionParamvar_equal_radioButtons = redRradioButtons( self.controlArea, label="var_equal:", buttons=["TRUE", "FALSE"], setChecked="FALSE", orientation='horizontal') self.RFunctionParamconf_level_lineEdit = redRlineEdit( self.controlArea, label="conf_level:", text='0.95') self.RFunctionParammu_lineEdit = redRlineEdit(self.controlArea, label="mu:", text='') redRCommitButton(self.bottomAreaRight, "Commit", callback=self.commitFunction) self.RoutputWindow = redRtextEdit(self.controlArea, label="R Output Window")
def __init__(self, parent=None, signalManager=None): OWRpy.__init__(self) self.setRvariableNames(["melt"]) self.require_librarys(["reshape"]) self.data = {} self.RFunctionParam_data = '' self.inputs.addInput("data", "Data Table", signals.RDataFrame.RDataFrame, self.processdata) self.outputs.addOutput("melt Output","Molten Data", signals.RDataFrame.RDataFrame) self.RFunctionParamna_rm_radioButtons = redRradioButtons(self.controlArea, label = "Remove NA's:", buttons = ["TRUE","FALSE"], setChecked = "TRUE") self.RFunctionParammeasure_vars_comboBox = redRcomboBox(self.controlArea, label = "Measure Variables (Values):") self.RFunctionParamvariable_name_lineEdit = redRlineEdit(self.controlArea, label = "New Variable Column Name:", text = 'variable') self.RFunctionParamid_vars_listBox = redRListBox(self.controlArea, label = "id_vars:") self.RFunctionParamid_vars_listBox.setSelectionMode(QAbstractItemView.ExtendedSelection) redRCommitButton(self.bottomAreaRight, "Commit", callback = self.commitFunction) self.RoutputWindow = redRtextEdit(self.controlArea, label = "R Output Window")
def __init__(self, parent=None, signalManager=None): OWRpy.__init__(self) self.path = os.path.abspath('/') self.data = None self.inputs.addInput("list", _("R Data"), signals.RVariable.RVariable, self.processlist) self.fileType = radioButtons(self.controlArea, label=_('Save File Type'), buttons=[_('Text'), _('R Data File')], setChecked=_('Text'), orientation='horizontal', callback=self.selectFileType) self.rDataFileOptions = widgetBox(self.controlArea, orientation='vertical') self.varName = redRlineEdit(self.rDataFileOptions, label=_("Variable Name")) self.textFileOptions = widgetBox(self.controlArea, orientation='vertical') self.rDataFileOptions.setDisabled(True) self.delimiter = radioButtons(self.textFileOptions, label=_('Column Seperator'), buttons={ '\t': _('Tab'), ' ': _('Space'), ',': _('Comma'), '?': _('Other') }, setChecked='\t', orientation='horizontal') self.otherSepText = redRlineEdit(self.delimiter.box, label=_('Seperator'), displayLabel=False, text=';', width=20, orientation='horizontal') QObject.connect(self.otherSepText, SIGNAL('textChanged(const QString &)'), lambda: self.delimiter.setChecked('Other')) twoColHolder = groupBox(self.textFileOptions, label=_('File Options'), orientation='horizontal') colOne = widgetBox(twoColHolder) colTwo = widgetBox(twoColHolder) self.fileOptions = redRcheckBox( colOne, label=_('Options'), displayLabel=False, buttons=[_('append'), _('quote'), _('row.names'), _('col.names')], setChecked=[_('quote'), _('col.names')], toolTips=[ _('If TRUE, the output is appended to the file.'), _(' If TRUE, any character or factor columns will be surrounded by double quotes.' ), _('a logical value indicating whether the row names of data are to be written.' ), _('a logical value indicating whether the column names of data are to be written.' ) ], orientation='vertical') self.eolChr = redRlineEdit(colTwo, label=_('End of line Chr:'), text='\\n', width=50) self.naStr = redRlineEdit(colTwo, label=_('Missing Value String:'), text='NA', width=50) self.decStr = redRlineEdit(colTwo, label=_('Decimel point Chr:'), text='.', width=50) self.qmethod = radioButtons( self.textFileOptions, label=_('Deal with embedded double quote characters '), buttons=[_('escape'), _('double')], setChecked=_('escape'), orientation='horizontal') self.browseBox = groupBox(self.controlArea, label=_("Save File"), addSpace=True, orientation='vertical') box = widgetBox(self.browseBox, orientation='horizontal') self.fileLocation = redRlineEdit(box, label=_('File Location'), displayLabel=False, orientation='horizontal') redRbutton(box, label=_('Browse'), callback=self.browseFile) self.commit = commitButton(self.bottomAreaRight, _("Save"), callback=self.commitFunction, processOnInput=True)
def __init__(self, parent=None, signalManager=None): #Here we init the parent class of our widget OWRpy. OWRpy.__init__(self) #create a R variable cor in the R session. #the output variable will not conflict with some other widgets variables self.setRvariableNames(["distri"]) # Define the outputs of this widget self.outputs.addOutput('id0', 'Results', redRRVector) #START THE GUI LAYOUT area = widgetBox(self.controlArea,orientation='horizontal') options = widgetBox(area,orientation='vertical') area.layout().setAlignment(options,Qt.AlignTop) self.count = RedRSpinBox(options, label='# Observations to Generate', min = 0,max=60000000, value = 10) self.methodButtons = redRcomboBox(options, label = "Distributions", items = [("rnorm", "Normal"), ('rbeta','Beta'), ('rbinom','Binomial'), ('rcauchy','Cauchy'), ('rchisq','Chi Square'), ('rexp','Exponential'), ('rf','F'), ('rgamma','Gamma') ], editable=True, callback = self.onDistChange) textBoxWidth = 70 self.distOptions = widgetBox(options) self.normalDist = groupBox(self.distOptions,label='Normal Distribution') self.normMean = redRlineEdit(self.normalDist, label='Mean',id='mean', text='0', width=textBoxWidth) self.normSD = redRlineEdit(self.normalDist, label='Standard Deviations',id='sd', text='1',width=textBoxWidth) self.betaDist = groupBox(self.distOptions,label='Beta Distribution') self.betaShape1 = redRlineEdit(self.betaDist, label='Shape 1', id='shape1', width=textBoxWidth,text='1') self.betaShape2 = redRlineEdit(self.betaDist, label='Shape 2', id='shape2', width=textBoxWidth,text='1') self.betaNCP = redRlineEdit(self.betaDist, label='Non-centrality', id='ncp', width=textBoxWidth,text='0') self.betaDist.hide() self.binomDist = groupBox(self.distOptions,label='Binomial Distribution') self.binomSize = redRlineEdit(self.binomDist, label='Size', id='size', width=textBoxWidth,text='1') self.binomProb = redRlineEdit(self.binomDist, label='Probability', id='prob', width=textBoxWidth,text='.5') self.binomDist.hide() self.cauchyDist = groupBox(self.distOptions,label='Cauchy Distribution') self.cauchyLocation = redRlineEdit(self.cauchyDist, label='Location', id='location', width=textBoxWidth,text='0') self.cauchyScale = redRlineEdit(self.cauchyDist, label='Scale', id='scale', width=textBoxWidth,text='1') self.cauchyDist.hide() self.gammaDist = groupBox(self.distOptions,label='Gamma Distribution') self.gammaShape = redRlineEdit(self.gammaDist, label='Shape', id='location', width=textBoxWidth,text='1') self.gammaRate = redRlineEdit(self.gammaDist, label='Rate', id='scale', width=textBoxWidth,text='1') self.gammaScale = redRlineEdit(self.gammaDist, label='Scale', id='scale', width=textBoxWidth,text='.5') self.gammaDist.hide() self.chiDist = groupBox(self.distOptions,label='Chi Square Distribution') self.chiDF = redRlineEdit(self.chiDist, label='Degrees of Freedom', id='df', width=textBoxWidth,text='1') self.chiNCP = redRlineEdit(self.chiDist, label='Non-centrality', id='ncp', width=textBoxWidth,text='0') self.chiDist.hide() self.fDist = groupBox(self.distOptions,label='F Distribution') self.fDF1 = redRlineEdit(self.fDist, label='Degrees of Freedom 1', id='df1', width=textBoxWidth,text='1') self.fDF2 = redRlineEdit(self.fDist, label='Degrees of Freedom 2', id='df2', width=textBoxWidth,text='1') self.fNCP = redRlineEdit(self.fDist, label='Non-centrality', id='ncp', width=textBoxWidth,text='0') self.fDist.hide() self.expDist = groupBox(self.distOptions,label='Exponential Distribution') self.expRate = redRlineEdit(self.expDist, label='Rate ', id='rate', width=textBoxWidth,text='1') self.expDist.hide() commit = redRCommitButton(options, "Commit", toolTip='Calculate values', callback = self.commitFunction) options.layout().setAlignment(commit, Qt.AlignRight)
def __init__(self, parent=None, signalManager=None): OWRpy.__init__(self) self.setRvariableNames(["clusterboot"]) self.data = {} self.require_librarys(["fpc"]) self.RFunctionParam_data = '' self.inputs.addInput("data", "data", signals.RMatrix.RMatrix, self.processdata) self.outputs.addOutput("clusterboot Output", "clusterboot Output", signals.RArbitraryList.RArbitraryList) self.RFunctionParamdistances_lineEdit = redRlineEdit( self.controlArea, label="distances:", text='') self.RFunctionParamB_lineEdit = redRlineEdit(self.controlArea, label="B:", text='100') self.RFunctionParamjittertuning_lineEdit = redRlineEdit( self.controlArea, label="jittertuning:", text='0.05') self.RFunctionParamclustermethod_lineEdit = redRlineEdit( self.controlArea, label="clustermethod:", text='') self.RFunctionParamdissolution_lineEdit = redRlineEdit( self.controlArea, label="dissolution:", text='0.5') self.RFunctionParammultipleboot_lineEdit = redRlineEdit( self.controlArea, label="multipleboot:", text='TRUE') self.RFunctionParambscompare_lineEdit = redRlineEdit( self.controlArea, label="bscompare:", text='FALSE') self.RFunctionParamshowplots_lineEdit = redRlineEdit( self.controlArea, label="showplots:", text='FALSE') self.RFunctionParamnoisetuning_lineEdit = redRlineEdit( self.controlArea, label="noisetuning:", text='0.0') self.RFunctionParambootmethod_lineEdit = redRlineEdit( self.controlArea, label="bootmethod:", text='') self.RFunctionParamrecover_lineEdit = redRlineEdit(self.controlArea, label="recover:", text='0.75') self.RFunctionParamsubtuning_lineEdit = redRlineEdit( self.controlArea, label="subtuning:", text='') self.RFunctionParamseed_lineEdit = redRlineEdit(self.controlArea, label="seed:", text='NULL') self.RFunctionParamnoisemethod_lineEdit = redRlineEdit( self.controlArea, label="noisemethod:", text='FALSE') redRCommitButton(self.bottomAreaRight, "Commit", callback=self.commitFunction)
def __init__(self, parent=None): QWizard.__init__(self, parent) self.libs = {} #layout = [QWizard.BackButton, QWizard.NextButton, QWizard.FinishButton] #self.setButtonLayout(layout) self.setWindowTitle(_('Red-R Setup')) self.settings = dict(redREnviron.settings) self.registerPage = QWizardPage() self.registerPage.setLayout(QVBoxLayout()) self.registerPage.setTitle(_('Please Register Red-R')) self.registerPage.setSubTitle( _('Registration will help us track errors to make Red-R better.')) self.email = redRlineEdit(self.registerPage, label=_('Email Address (Optional):'), width=-1) self.allowContact = redRradioButtons( self.registerPage, label=_('Red-R can contact me to ask about errors:'), buttons=[_('Yes'), _('No')]) self.allowContact.setChecked(_('Yes')) self.errorReportingPage = QWizardPage() self.errorReportingPage.setLayout(QVBoxLayout()) self.errorReportingPage.setTitle(_('Error Reporting')) self.errorReportingPage.setSubTitle( _('How would you like errors to be reported to Red-R.')) self.redRExceptionHandling = redRcheckBox( self.errorReportingPage, label='exceptionHandling', buttons=[ _('Show output window on exception'), _('Print last exception in status bar'), _('Submit Error Report'), _('Always ask before submitting error report') ], toolTips=[ _('Check this if you want to see the output when an error happens.' ), _('Check this if you want the last exception printed in the status bar.' ), _('Check this if you want to send errors to Red-R.\nWe will only show the errors to Red-R or package maintainers.' ), _('Check this if you want to be asked before a report is sent to Red-R.\nOtherwise a report will be sent automatically to Red-R.' ) ]) self.redRExceptionHandling.setChecked([_('Submit Error Report')]) self.RSetupPage = QWizardPage() self.RSetupPage.setLayout(QVBoxLayout()) self.RSetupPage.setTitle(_('R Repository')) self.RSetupPage.setSubTitle( _('Please set the repository closest to you. This will help you get R packages faster.' )) self.rlibrariesBox = redRgroupBox(self.RSetupPage, _('R Libraries')) self.libInfo = redRwidgetLabel(self.rlibrariesBox, label=_('Repository URL: ') + self.settings['CRANrepos']) # place a listBox in the widget and fill it with a list of mirrors redRButton(self.rlibrariesBox, _('Get Libraries'), callback=self.loadMirrors) self.libListBox = redRlistBox(self.rlibrariesBox, label=_('Mirrors'), callback=self.setMirror) self.libMessageBox = redRwidgetLabel(self.rlibrariesBox) self.runExamplePage = QWizardPage() self.runExamplePage.setLayout(QVBoxLayout()) self.runExamplePage.setTitle(_('Finish')) self.runExamplePage.setSubTitle( _('Thanks for setting up Red-R.\n\nIf you want to start an example schema to help you get started then check the "Start Example" box.' )) self.showExample = redRcheckBox(self.runExamplePage, label=_('Show Example'), buttons=[_('Start Example')], setChecked=[_('Start Example')]) self.addPage(self.registerPage) self.addPage(self.errorReportingPage) self.addPage(self.RSetupPage) self.addPage(self.runExamplePage)