@@ -128,17 +128,14 @@ LSbinomialestimation <- function(jaspResults, dataset, options, state = NULL)
128
128
129
129
estimatesContainer [[" estimatesTable" ]] <- estimatesTable
130
130
131
- if (ready [" data" ] && ! ready [" models" ])
132
- return ()
133
- else if (! ready [" data" ]) {
134
-
135
- if ((options [[" dataInputType" ]] == " variable" && options [[" dataVariableSelected" ]] != " " ) ||
136
- (options [[" dataInputType" ]] == " sequence" && options [[" dataSequenceSequenceOfObservations" ]] != " " ))
137
- estimatesTable $ addFootnote(gettext(" Please specify successes and failures." ))
131
+ if ((options [[" dataInputType" ]] == " variable" && options [[" dataVariableSelected" ]] != " " && sum(data $ nSuccesses , data $ nFailures ) == 0 ) ||
132
+ (options [[" dataInputType" ]] == " sequence" && options [[" dataSequenceSequenceOfObservations" ]] != " " && sum(data $ nSuccesses , data $ nFailures ) == 0 ))
133
+ estimatesTable $ addFootnote(gettext(" Please specify successes and failures." ))
138
134
135
+ if (ready [" data" ] && ! ready [" models" ])
139
136
return ()
140
137
141
- } else if (ready [" models" ]) {
138
+ else if (ready [" models" ]) {
142
139
143
140
# add rows for each hypothesis
144
141
for (i in 1 : length(options [[" models" ]])) {
@@ -210,7 +207,7 @@ LSbinomialestimation <- function(jaspResults, dataset, options, state = NULL)
210
207
}
211
208
212
209
213
- if (! all(ready ))
210
+ if (! all(ready ) || ( ready [ " models " ] && sum( data $ nSuccesses , data $ nFailures ) == 0 ) )
214
211
return ()
215
212
else {
216
213
# add models to the first row
@@ -562,7 +559,7 @@ LSbinomialestimation <- function(jaspResults, dataset, options, state = NULL)
562
559
" colorPalette" ))
563
560
containerIterative [[" plotsIterative" ]] <- plotsIterative
564
561
565
- if (! all(ready ))
562
+ if (! all(ready ) || sum( data $ nSuccesses , data $ nFailures ) == 0 )
566
563
return ()
567
564
568
565
plotDataLines <- list ()
@@ -731,7 +728,7 @@ LSbinomialestimation <- function(jaspResults, dataset, options, state = NULL)
731
728
plotsIterative [[" " ]] <- createJaspPlot(title = " " , width = 530 , height = 400 , aspectRatio = 0.7 )
732
729
return ()
733
730
734
- } else if (! ready [" data" ] && ready [" models" ]) {
731
+ } else if (( ! ready [" data" ] && ready [" models" ]) || sum( data $ nSuccesses , data $ nFailures ) == 0 ) {
735
732
736
733
for (i in 1 : length(options [[" models" ]])) {
737
734
plotsIterative [[options [[" models" ]][[i ]]$ name ]] <- createJaspPlot(title = options [[" models" ]][[i ]]$ name ,
@@ -822,7 +819,7 @@ LSbinomialestimation <- function(jaspResults, dataset, options, state = NULL)
822
819
" sequentialAnalysisIntervalEstimatePlotLower" , " sequentialAnalysisIntervalEstimatePlotUpper" , " colorPalette" ))
823
820
containerIterativeInterval [[" sequentialAnalysisIntervalEstimatePlot" ]] <- plotsIterativeInterval
824
821
825
- if (! all(ready ))
822
+ if (! all(ready ) || sum( data $ nSuccesses , data $ nFailures ) == 0 )
826
823
return ()
827
824
828
825
@@ -895,7 +892,7 @@ LSbinomialestimation <- function(jaspResults, dataset, options, state = NULL)
895
892
plotsIterativeInterval [[" " ]] <- createJaspPlot(title = " " , width = 530 , height = 400 , aspectRatio = 0.7 )
896
893
return ()
897
894
898
- } else if (! ready [" data" ] && ready [" models" ]) {
895
+ } else if (( ! ready [" data" ] && ready [" models" ]) || sum( data $ nSuccesses , data $ nFailures ) == 0 ) {
899
896
900
897
for (i in 1 : length(options [[" models" ]])) {
901
898
plotsIterativeInterval [[options [[" models" ]][[i ]]$ name ]] <- createJaspPlot(title = options [[" models" ]][[i ]]$ name ,
@@ -1019,7 +1016,7 @@ LSbinomialestimation <- function(jaspResults, dataset, options, state = NULL)
1019
1016
}
1020
1017
}
1021
1018
1022
- if (! all(ready ))
1019
+ if (! all(ready ) || ( ready [ " models " ] && sum( data $ nSuccesses , data $ nFailures ) == 0 ) )
1023
1020
return ()
1024
1021
1025
1022
iterSeq <- 0 : length(data [[" y" ]])
@@ -1097,7 +1094,7 @@ LSbinomialestimation <- function(jaspResults, dataset, options, state = NULL)
1097
1094
}
1098
1095
}
1099
1096
1100
- if (! all(ready ))
1097
+ if (! all(ready ) || ( ready [ " models " ] && sum( data $ nSuccesses , data $ nFailures ) == 0 ) )
1101
1098
return ()
1102
1099
1103
1100
iterSeq <- 0 : length(data [[" y" ]])
@@ -1150,17 +1147,14 @@ LSbinomialestimation <- function(jaspResults, dataset, options, state = NULL)
1150
1147
1151
1148
containerPredictions [[" predictionsTable" ]] <- predictionsTable
1152
1149
1153
- if (ready [" data" ] && ! ready [" models" ])
1154
- return ()
1155
- else if (! ready [" data" ]) {
1156
-
1157
- if ((options [[" dataInputType" ]] == " variable" && options [[" dataVariableSelected" ]] != " " ) ||
1158
- (options [[" dataInputType" ]] == " sequence" && options [[" dataSequenceSequenceOfObservations" ]] != " " ))
1159
- predictionsTable $ addFootnote(gettext(" Please specify successes and failures." ))
1150
+ if ((options [[" dataInputType" ]] == " variable" && options [[" dataVariableSelected" ]] != " " && sum(data $ nSuccesses , data $ nFailures ) == 0 ) ||
1151
+ (options [[" dataInputType" ]] == " sequence" && options [[" dataSequenceSequenceOfObservations" ]] != " " && sum(data $ nSuccesses , data $ nFailures ) == 0 ))
1152
+ predictionsTable $ addFootnote(gettext(" Please specify successes and failures." ))
1160
1153
1154
+ if (ready [" data" ] && ! ready [" models" ])
1161
1155
return ()
1162
1156
1163
- } else {
1157
+ else {
1164
1158
1165
1159
# add rows for each hypothesis
1166
1160
for (i in 1 : length(options [[" models" ]])) {
@@ -1413,6 +1407,9 @@ LSbinomialestimation <- function(jaspResults, dataset, options, state = NULL)
1413
1407
tablePredictions $ addColumns(0 : options [[" posteriorPredictionNumberOfFutureTrials" ]])
1414
1408
}
1415
1409
1410
+ if ((options [[" dataInputType" ]] == " variable" && options [[" dataVariableSelected" ]] != " " && sum(data $ nSuccesses , data $ nFailures ) == 0 ) ||
1411
+ (options [[" dataInputType" ]] == " sequence" && options [[" dataSequenceSequenceOfObservations" ]] != " " && sum(data $ nSuccesses , data $ nFailures ) == 0 ))
1412
+ tablePredictions $ addFootnote(gettext(" Please specify successes and failures." ))
1416
1413
1417
1414
if (ready [" models" ]) {
1418
1415
for (i in seq_along(options [[" models" ]])) {
@@ -1422,16 +1419,6 @@ LSbinomialestimation <- function(jaspResults, dataset, options, state = NULL)
1422
1419
return ()
1423
1420
1424
1421
1425
- if (! ready [" data" ]) {
1426
-
1427
- if ((options [[" dataInputType" ]] == " variable" && options [[" dataVariableSelected" ]] != " " ) ||
1428
- (options [[" dataInputType" ]] == " sequence" && options [[" dataSequenceSequenceOfObservations" ]] != " " ))
1429
- tablePredictions $ addFootnote(gettext(" Please specify successes and failures." ))
1430
-
1431
- return ()
1432
- }
1433
-
1434
-
1435
1422
tempPred <- NULL
1436
1423
1437
1424
for (i in 1 : length(options [[" models" ]])) {
0 commit comments