Skip to content

Commit 3bd57a8

Browse files
committed
adjust conditions to show_call
1 parent 4b04aa6 commit 3bd57a8

30 files changed

+30
-30
lines changed

R/bag_mars.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ print.bag_mars <- function(x, ...) {
4747
cat("Bagged MARS Model Specification (", x$mode, ")\n\n", sep = "")
4848
model_printer(x, ...)
4949

50-
if (!is.null(x$method$fit$args)) {
50+
if (!is.null(x$method$fit$args) && has_loaded_implementation(x)) {
5151
cat("Model fit template:\n")
5252
print(show_call(x))
5353
}

R/bag_tree.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ print.bag_tree <- function(x, ...) {
5151
cat("Bagged Decision Tree Model Specification (", x$mode, ")\n\n", sep = "")
5252
model_printer(x, ...)
5353

54-
if (!is.null(x$method$fit$args)) {
54+
if (!is.null(x$method$fit$args) && has_loaded_implementation(x)) {
5555
cat("Model fit template:\n")
5656
print(show_call(x))
5757
}

R/bart.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ print.bart <- function(x, ...) {
9595
cat("BART Model Specification (", x$mode, ")\n\n", sep = "")
9696
model_printer(x, ...)
9797

98-
if(!is.null(x$method$fit$args)) {
98+
if (!is.null(x$method$fit$args) && has_loaded_implementation(x)) {
9999
cat("Model fit template:\n")
100100
print(show_call(x))
101101
}

R/boost_tree.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ print.boost_tree <- function(x, ...) {
8484
cat("Boosted Tree Model Specification (", x$mode, ")\n\n", sep = "")
8585
model_printer(x, ...)
8686

87-
if (!is.null(x$method$fit$args)) {
87+
if (!is.null(x$method$fit$args) && has_loaded_implementation(x)) {
8888
cat("Model fit template:\n")
8989
print(show_call(x))
9090
}

R/c5_rules.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ print.C5_rules <- function(x, ...) {
6868
cat("C5.0 Model Specification (", x$mode, ")\n\n", sep = "")
6969
model_printer(x, ...)
7070

71-
if (!is.null(x$method$fit$args)) {
71+
if (!is.null(x$method$fit$args) && has_loaded_implementation(x)) {
7272
cat("Model fit template:\n")
7373
print(show_call(x))
7474
}

R/cubist_rules.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ print.cubist_rules <- function(x, ...) {
9494
cat("Cubist Model Specification (", x$mode, ")\n\n", sep = "")
9595
model_printer(x, ...)
9696

97-
if (!is.null(x$method$fit$args)) {
97+
if (!is.null(x$method$fit$args) && has_loaded_implementation(x)) {
9898
cat("Model fit template:\n")
9999
print(show_call(x))
100100
}

R/decision_tree.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ print.decision_tree <- function(x, ...) {
5656
cat("Decision Tree Model Specification (", x$mode, ")\n\n", sep = "")
5757
model_printer(x, ...)
5858

59-
if (!is.null(x$method$fit$args)) {
59+
if (!is.null(x$method$fit$args) && has_loaded_implementation(x)) {
6060
cat("Model fit template:\n")
6161
print(show_call(x))
6262
}

R/discrim_flexible.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ print.discrim_flexible <- function(x, ...) {
5050
cat("Flexible Discriminant Model Specification (", x$mode, ")\n\n", sep = "")
5151
model_printer(x, ...)
5252

53-
if (!is.null(x$method$fit$args)) {
53+
if (!is.null(x$method$fit$args) && has_loaded_implementation(x)) {
5454
cat("Model fit template:\n")
5555
print(show_call(x))
5656
}

R/discrim_linear.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ print.discrim_linear <- function(x, ...) {
5252
cat("Linear Discriminant Model Specification (", x$mode, ")\n\n", sep = "")
5353
model_printer(x, ...)
5454

55-
if (!is.null(x$method$fit$args)) {
55+
if (!is.null(x$method$fit$args) && has_loaded_implementation(x)) {
5656
cat("Model fit template:\n")
5757
print(show_call(x))
5858
}

R/discrim_quad.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ print.discrim_quad <- function(x, ...) {
4646
cat("Quadratic Discriminant Model Specification (", x$mode, ")\n\n", sep = "")
4747
model_printer(x, ...)
4848

49-
if (!is.null(x$method$fit$args)) {
49+
if (!is.null(x$method$fit$args) && has_loaded_implementation(x)) {
5050
cat("Model fit template:\n")
5151
print(show_call(x))
5252
}

R/discrim_regularized.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ print.discrim_regularized <- function(x, ...) {
6767
cat("Regularized Discriminant Model Specification (", x$mode, ")\n\n", sep = "")
6868
model_printer(x, ...)
6969

70-
if (!is.null(x$method$fit$args)) {
70+
if (!is.null(x$method$fit$args) && has_loaded_implementation(x)) {
7171
cat("Model fit template:\n")
7272
print(show_call(x))
7373
}

R/gen_additive_mod.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ print.gen_additive_mod <- function(x, ...) {
5555
cat("GAM Specification (", x$mode, ")\n\n", sep = "")
5656
model_printer(x, ...)
5757

58-
if(!is.null(x$method$fit$args)) {
58+
if (!is.null(x$method$fit$args) && has_loaded_implementation(x)) {
5959
cat("Model fit template:\n")
6060
print(show_call(x))
6161
}

R/linear_reg.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ print.linear_reg <- function(x, ...) {
6363
cat("Linear Regression Model Specification (", x$mode, ")\n\n", sep = "")
6464
model_printer(x, ...)
6565

66-
if (!is.null(x$method$fit$args)) {
66+
if (!is.null(x$method$fit$args) && has_loaded_implementation(x)) {
6767
cat("Model fit template:\n")
6868
print(show_call(x))
6969
}

R/logistic_reg.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ print.logistic_reg <- function(x, ...) {
7070
cat("Logistic Regression Model Specification (", x$mode, ")\n\n", sep = "")
7171
model_printer(x, ...)
7272

73-
if(!is.null(x$method$fit$args)) {
73+
if (!is.null(x$method$fit$args) && has_loaded_implementation(x)) {
7474
cat("Model fit template:\n")
7575
print(show_call(x))
7676
}

R/mars.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ print.mars <- function(x, ...) {
5454
cat("MARS Model Specification (", x$mode, ")\n\n", sep = "")
5555
model_printer(x, ...)
5656

57-
if(!is.null(x$method$fit$args)) {
57+
if (!is.null(x$method$fit$args) && has_loaded_implementation(x)) {
5858
cat("Model fit template:\n")
5959
print(show_call(x))
6060
}

R/mlp.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ print.mlp <- function(x, ...) {
6464
cat("Single Layer Neural Network Specification (", x$mode, ")\n\n", sep = "")
6565
model_printer(x, ...)
6666

67-
if(!is.null(x$method$fit$args)) {
67+
if (!is.null(x$method$fit$args) && has_loaded_implementation(x)) {
6868
cat("Model fit template:\n")
6969
print(show_call(x))
7070
}

R/multinom_reg.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ print.multinom_reg <- function(x, ...) {
7070
cat("Multinomial Regression Model Specification (", x$mode, ")\n\n", sep = "")
7171
model_printer(x, ...)
7272

73-
if (!is.null(x$method$fit$args)) {
73+
if (!is.null(x$method$fit$args) && has_loaded_implementation(x)) {
7474
cat("Model fit template:\n")
7575
print(show_call(x))
7676
}

R/naive_Bayes.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ print.naive_Bayes <- function(x, ...) {
4949
cat("Naive Bayes Model Specification (", x$mode, ")\n\n", sep = "")
5050
model_printer(x, ...)
5151

52-
if (!is.null(x$method$fit$args)) {
52+
if (!is.null(x$method$fit$args) && has_loaded_implementation(x)) {
5353
cat("Model fit template:\n")
5454
print(show_call(x))
5555
}

R/nearest_neighbor.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ print.nearest_neighbor <- function(x, ...) {
6060
cat("K-Nearest Neighbor Model Specification (", x$mode, ")\n\n", sep = "")
6161
model_printer(x, ...)
6262

63-
if(!is.null(x$method$fit$args)) {
63+
if (!is.null(x$method$fit$args) && has_loaded_implementation(x)) {
6464
cat("Model fit template:\n")
6565
print(show_call(x))
6666
}

R/pls.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ print.pls <- function(x, ...) {
4545
cat("PLS Model Specification (", x$mode, ")\n\n", sep = "")
4646
model_printer(x, ...)
4747

48-
if (!is.null(x$method$fit$args)) {
48+
if (!is.null(x$method$fit$args) && has_loaded_implementation(x)) {
4949
cat("Model fit template:\n")
5050
print(show_call(x))
5151
}

R/poisson_reg.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ print.poisson_reg <- function(x, ...) {
5656
cat("Poisson Regression Model Specification (", x$mode, ")\n\n", sep = "")
5757
model_printer(x, ...)
5858

59-
if (!is.null(x$method$fit$args)) {
59+
if (!is.null(x$method$fit$args) && has_loaded_implementation(x)) {
6060
cat("Model fit template:\n")
6161
print(show_call(x))
6262
}

R/proportional_hazards.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ print.proportional_hazards <- function(x, ...) {
5858
cat("Proportional Hazards Model Specification (", x$mode, ")\n\n", sep = "")
5959
model_printer(x, ...)
6060

61-
if (!is.null(x$method$fit$args)) {
61+
if (!is.null(x$method$fit$args) && has_loaded_implementation(x)) {
6262
cat("Model fit template:\n")
6363
print(show_call(x))
6464
}

R/rand_forest.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ print.rand_forest <- function(x, ...) {
5656
cat("Random Forest Model Specification (", x$mode, ")\n\n", sep = "")
5757
model_printer(x, ...)
5858

59-
if(!is.null(x$method$fit$args)) {
59+
if (!is.null(x$method$fit$args) && has_loaded_implementation(x)) {
6060
cat("Model fit template:\n")
6161
print(show_call(x))
6262
}

R/rule_fit.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ print.rule_fit <- function(x, ...) {
7070
cat("RuleFit Model Specification (", x$mode, ")\n\n", sep = "")
7171
model_printer(x, ...)
7272

73-
if (!is.null(x$method$fit$args)) {
73+
if (!is.null(x$method$fit$args) && has_loaded_implementation(x)) {
7474
cat("Model fit template:\n")
7575
print(show_call(x))
7676
}

R/surv_reg.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ print.surv_reg <- function(x, ...) {
5757
cat("Parametric Survival Regression Model Specification (", x$mode, ")\n\n", sep = "")
5858
model_printer(x, ...)
5959

60-
if(!is.null(x$method$fit$args)) {
60+
if (!is.null(x$method$fit$args) && has_loaded_implementation(x)) {
6161
cat("Model fit template:\n")
6262
print(show_call(x))
6363
}

R/survival_reg.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ print.survival_reg <- function(x, ...) {
5151
cat("Parametric Survival Regression Model Specification (", x$mode, ")\n\n", sep = "")
5252
model_printer(x, ...)
5353

54-
if (!is.null(x$method$fit$args)) {
54+
if (!is.null(x$method$fit$args) && has_loaded_implementation(x)) {
5555
cat("Model fit template:\n")
5656
print(show_call(x))
5757
}

R/svm_linear.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ print.svm_linear <- function(x, ...) {
5555
cat("Linear Support Vector Machine Specification (", x$mode, ")\n\n", sep = "")
5656
model_printer(x, ...)
5757

58-
if(!is.null(x$method$fit$args)) {
58+
if (!is.null(x$method$fit$args) && has_loaded_implementation(x)) {
5959
cat("Model fit template:\n")
6060
print(show_call(x))
6161
}

R/svm_poly.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ print.svm_poly <- function(x, ...) {
6060
cat("Polynomial Support Vector Machine Specification (", x$mode, ")\n\n", sep = "")
6161
model_printer(x, ...)
6262

63-
if(!is.null(x$method$fit$args)) {
63+
if (!is.null(x$method$fit$args) && has_loaded_implementation(x)) {
6464
cat("Model fit template:\n")
6565
print(show_call(x))
6666
}

R/svm_rbf.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ print.svm_rbf <- function(x, ...) {
6161
cat("Radial Basis Function Support Vector Machine Specification (", x$mode, ")\n\n", sep = "")
6262
model_printer(x, ...)
6363

64-
if(!is.null(x$method$fit$args)) {
64+
if (!is.null(x$method$fit$args) && has_loaded_implementation(x)) {
6565
cat("Model fit template:\n")
6666
print(show_call(x))
6767
}

R/translate.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ translate.default <- function(x, engine = x$engine, ...) {
101101
print.model_spec <- function(x, ...) {
102102
cat("Model Specification (", x$mode, ")\n\n", sep = "")
103103
model_printer(x, ...)
104-
if (!is.null(x$method$fit$args)) {
104+
if (!is.null(x$method$fit$args) && has_loaded_implementation(x)) {
105105
cat("Model fit template:\n")
106106
print(show_call(x))
107107
}

0 commit comments

Comments
 (0)