Skip to content

Commit ad7b039

Browse files
shiny namespace error
1 parent ab7cf6a commit ad7b039

9 files changed

+19
-71
lines changed

NAMESPACE

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -195,8 +195,6 @@ importFrom(rlang,prepend)
195195
importFrom(rlang,quo_name)
196196
importFrom(rlang,quos)
197197
importFrom(rlang,sym)
198-
importFrom(shiny,isRunning)
199-
importFrom(shiny,runApp)
200198
importFrom(stats,AIC)
201199
importFrom(stats,BIC)
202200
importFrom(stats,as.formula)

R/blr-backward-elimination.R

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -173,9 +173,7 @@ blr_step_aic_backward.default <- function(model, details = FALSE, ...) {
173173
bics <- c()
174174
devs <- c()
175175

176-
if (isRunning()) {
177-
cat(paste("-", dplyr::last(rpred)), "\n")
178-
} else if (interactive()) {
176+
if (interactive()) {
179177
cat(crayon::red(clisymbols::symbol$cross), crayon::bold(dplyr::last(rpred)), "\n")
180178
} else {
181179
cat(paste("-", dplyr::last(rpred)), "\n")
@@ -242,9 +240,7 @@ blr_step_aic_backward.default <- function(model, details = FALSE, ...) {
242240
cat("\n\n")
243241
cat("Variables Removed:", "\n\n")
244242
for (i in seq_len(length(rpred))) {
245-
if (isRunning()) {
246-
cat(paste("-", rpred[i]), "\n")
247-
} else if (interactive()) {
243+
if (interactive()) {
248244
cat(crayon::red(clisymbols::symbol$cross), crayon::bold(rpred[i]), "\n")
249245
} else {
250246
cat(paste("-", rpred[i]), "\n")

R/blr-forward-selection.R

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,6 @@
4646
#' k$model
4747
#'
4848
#' }
49-
#'
50-
#' @importFrom shiny isRunning
5149
#'
5250
#' @family variable selection procedures
5351
#'
@@ -159,9 +157,7 @@ blr_step_aic_forward.default <- function(model, details = FALSE, ...) {
159157
cat("Variables Entered:", "\n\n")
160158
}
161159

162-
if (isRunning()) {
163-
cat(paste("-", dplyr::last(preds)), "\n")
164-
} else if (interactive()) {
160+
if (interactive()) {
165161
cat(crayon::green(clisymbols::symbol$tick), crayon::bold(dplyr::last(preds)), "\n")
166162
} else {
167163
cat(paste("-", dplyr::last(preds)), "\n")
@@ -241,9 +237,7 @@ blr_step_aic_forward.default <- function(model, details = FALSE, ...) {
241237
step <- step + 1
242238

243239

244-
if (isRunning()) {
245-
cat(paste("-", dplyr::last(preds)), "\n")
246-
} else if (interactive()) {
240+
if (interactive()) {
247241
cat(crayon::green(clisymbols::symbol$tick), crayon::bold(dplyr::last(preds)), "\n")
248242
} else {
249243
cat(paste("-", dplyr::last(preds)), "\n")
@@ -259,9 +253,7 @@ blr_step_aic_forward.default <- function(model, details = FALSE, ...) {
259253
cat("\n\n")
260254
cat("Variables Entered:", "\n\n")
261255
for (i in seq_len(length(preds))) {
262-
if (isRunning()) {
263-
cat(paste("-", preds[i]), "\n")
264-
} else if (interactive()) {
256+
if (interactive()) {
265257
cat(crayon::green(clisymbols::symbol$tick), crayon::bold(preds[i]), "\n")
266258
} else {
267259
cat(paste("-", preds[i]), "\n")

R/blr-launch-app.R

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
#' @importFrom shiny runApp
21
#' @title Launch shiny app
32
#' @description Launches shiny app for interactive model building.
43
#' @examples

R/blr-regress-compute.R

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,7 @@ blr_reg_comp <- function(formula, data, odd_conf_limit) {
33
model <- glm(formula = formula, data = data,
44
family = binomial(link = "logit"))
55

6-
if (isRunning()) {
7-
cat(paste("-", "Creating model overview."), "\n")
8-
} else if (interactive()) {
6+
if (interactive()) {
97
cat(crayon::green(clisymbols::symbol$tick),
108
crayon::bold("Creating model overview."), "\n")
119
} else {
@@ -19,9 +17,7 @@ blr_reg_comp <- function(formula, data, odd_conf_limit) {
1917
resid_df <- residual_df(model)
2018
mod_df <- model_df(model)
2119

22-
if (isRunning()) {
23-
cat(paste("-", "Creating response profile."), "\n")
24-
} else if (interactive()) {
20+
if (interactive()) {
2521
cat(crayon::green(clisymbols::symbol$tick),
2622
crayon::bold("Creating response profile."), "\n")
2723
} else {
@@ -30,9 +26,7 @@ blr_reg_comp <- function(formula, data, odd_conf_limit) {
3026

3127
resp_prof <- resp_profile(model)
3228

33-
if (isRunning()) {
34-
cat(paste("-", "Extracting maximum likelihood estimates."), "\n")
35-
} else if (interactive()) {
29+
if (interactive()) {
3630
cat(crayon::green(clisymbols::symbol$tick),
3731
crayon::bold("Extracting maximum likelihood estimates."), "\n")
3832
} else {
@@ -48,9 +42,7 @@ blr_reg_comp <- function(formula, data, odd_conf_limit) {
4842

4943
if (odd_conf_limit) {
5044

51-
if (isRunning()) {
52-
cat(paste("-", "Computing odds ratio estimates."), "\n")
53-
} else if (interactive()) {
45+
if (interactive()) {
5446
cat(crayon::green(clisymbols::symbol$tick),
5547
crayon::bold("Computing odds ratio estimates."), "\n")
5648
} else {
@@ -63,9 +55,7 @@ blr_reg_comp <- function(formula, data, odd_conf_limit) {
6355

6456
}
6557

66-
if (isRunning()) {
67-
cat(paste("-", "Estimating concordant and discordant pairs."), "\n")
68-
} else if (interactive()) {
58+
if (interactive()) {
6959
cat(crayon::green(clisymbols::symbol$tick),
7060
crayon::bold("Estimating concordant and discordant pairs."), "\n\n")
7161
} else {

R/blr-stepwise-backward-regression.R

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -118,15 +118,8 @@ blr_step_p_backward.default <- function(model, prem = 0.3, details = FALSE, ...)
118118
aic <- c(aic, mfs$m_aic)
119119
bic <- c(bic, mfs$m_bic)
120120
dev <- c(dev, mfs$m_deviance)
121-
# fr <- ols_regress(paste(response, "~",
122-
# paste(preds, collapse = " + ")), l)
123-
# aic <- c(aic, ols_aic(fr$model))
124-
# bic <- c(sbc, ols_sbc(fr$model))
125-
# dev <- c(sbic, ols_sbic(fr$model, model))
126-
127-
if (isRunning()) {
128-
cat(paste("-", dplyr::last(rpred), "added"), "\n")
129-
} else if (interactive()) {
121+
122+
if (interactive()) {
130123
cat(crayon::red(clisymbols::symbol$cross), crayon::bold(dplyr::last(rpred)), "\n")
131124
} else {
132125
cat(paste("-", dplyr::last(rpred)), "\n")
@@ -152,9 +145,7 @@ blr_step_p_backward.default <- function(model, prem = 0.3, details = FALSE, ...)
152145
cat("\n\n")
153146
cat("Variables Removed:", "\n\n")
154147
for (i in seq_len(length(rpred))) {
155-
if (isRunning()) {
156-
cat(paste("-", rpred[i], "added"), "\n")
157-
} else if (interactive()) {
148+
if (interactive()) {
158149
cat(crayon::red(clisymbols::symbol$cross), crayon::bold(rpred[i]), "\n")
159150
} else {
160151
cat(paste("-", rpred[i]), "\n")

R/blr-stepwise-forward-regression.R

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -131,9 +131,7 @@ blr_step_p_forward.default <- function(model, penter = 0.3, details = FALSE, ...
131131
cat(paste("Forward Selection: Step", step), "\n\n")
132132
}
133133

134-
if (isRunning()) {
135-
cat(paste("-", dplyr::last(preds), "added"), "\n")
136-
} else if (interactive()) {
134+
if (interactive()) {
137135
cat(crayon::green(clisymbols::symbol$tick), crayon::bold(dplyr::last(preds)), "\n")
138136
} else {
139137
cat(paste("-", dplyr::last(preds)), "\n")
@@ -191,9 +189,7 @@ blr_step_p_forward.default <- function(model, penter = 0.3, details = FALSE, ...
191189
cat(paste("Forward Selection: Step", step), "\n\n")
192190
}
193191

194-
if (isRunning()) {
195-
cat(paste("-", dplyr::last(preds), "added"), "\n")
196-
} else if (interactive()) {
192+
if (interactive()) {
197193
cat(crayon::green(clisymbols::symbol$tick), crayon::bold(dplyr::last(preds)), "\n")
198194
} else {
199195
cat(paste("-", dplyr::last(preds)), "\n")
@@ -216,9 +212,7 @@ blr_step_p_forward.default <- function(model, penter = 0.3, details = FALSE, ...
216212
cat("\n\n")
217213
cat("Variables Entered:", "\n\n")
218214
for (i in seq_len(length(preds))) {
219-
if (isRunning()) {
220-
cat(paste("+", preds[i]), "\n")
221-
} else if (interactive()) {
215+
if (interactive()) {
222216
cat(crayon::green(clisymbols::symbol$tick), crayon::bold(preds[i]), "\n")
223217
} else {
224218
cat(paste("+", preds[i]), "\n")

R/blr-stepwise-regression.R

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -154,9 +154,6 @@ blr_step_p_both.default <- function(model, pent = 0.1, prem = 0.3, details = FAL
154154
cat(paste("Stepwise Selection: Step", step), "\n\n")
155155
}
156156

157-
if (isRunning()) {
158-
cat(paste("-", dplyr::last(preds), "added"), "\n")
159-
} else
160157
if (interactive()) {
161158
cat(crayon::green(clisymbols::symbol$tick), crayon::bold(dplyr::last(preds)), "\n")
162159
} else {
@@ -236,9 +233,7 @@ blr_step_p_both.default <- function(model, pent = 0.1, prem = 0.3, details = FAL
236233
cat(paste("Stepwise Selection: Step", step), "\n\n")
237234
}
238235

239-
if (isRunning()) {
240-
cat(paste("-", dplyr::last(preds), "added"), "\n")
241-
} else if (interactive()) {
236+
if (interactive()) {
242237
cat(crayon::green(clisymbols::symbol$tick), crayon::bold(dplyr::last(preds)), "\n")
243238
} else {
244239
cat(paste("-", dplyr::last(preds), "added"), "\n")
@@ -296,9 +291,6 @@ blr_step_p_both.default <- function(model, pent = 0.1, prem = 0.3, details = FAL
296291
cat(paste("Stepwise Selection: Step", all_step), "\n\n")
297292
}
298293

299-
if (isRunning()) {
300-
cat(paste("-", dplyr::last(var_index), "added"), "\n")
301-
} else
302294
if (interactive()) {
303295
cat(crayon::red(clisymbols::symbol$cross), crayon::bold(dplyr::last(var_index)), "\n")
304296
} else {

R/blr-stepwise-selection.R

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -172,9 +172,7 @@ blr_step_aic_both.default <- function(model, details = FALSE, ...) {
172172
lbic <- c(lbic, mbic)
173173
ldev <- c(ldev, mdev)
174174

175-
if (isRunning()) {
176-
cat(paste("-", dplyr::last(preds), "added"), "\n")
177-
} else if (interactive()) {
175+
if (interactive()) {
178176
cat(crayon::green(clisymbols::symbol$tick), crayon::bold(dplyr::last(preds)), "\n")
179177
} else {
180178
cat(paste("-", dplyr::last(preds), "added"), "\n")
@@ -253,9 +251,7 @@ blr_step_aic_both.default <- function(model, details = FALSE, ...) {
253251
method <- c(method, tech[2])
254252
all_step <- all_step + 1
255253

256-
if (isRunning()) {
257-
cat(paste("-", preds[minc2], "removed"), "\n")
258-
} else if (interactive()) {
254+
if (interactive()) {
259255
cat(crayon::red(clisymbols::symbol$cross), crayon::bold(preds[minc2]), "\n")
260256
} else {
261257
cat(paste("-", preds[minc2], "removed"), "\n")

0 commit comments

Comments
 (0)