Improve warning message
diff --git a/R/add_header_above.R b/R/add_header_above.R
index bf99378..72fac20 100644
--- a/R/add_header_above.R
+++ b/R/add_header_above.R
@@ -28,8 +28,10 @@
monospace = FALSE, escape = TRUE) {
kable_format <- attr(kable_input, "format")
if (!kable_format %in% c("html", "latex")) {
- stop("Please specify output format in your kable function. Currently ",
- "generic markdown table using pandoc is not supported.")
+ warning("Please specify format in kable. kableExtra can customize either ",
+ "HTML or LaTeX outputs. See https://haozhu233.github.io/kableExtra/ ",
+ "for details.")
+ return(kable_input)
}
if (kable_format == "html") {
return(htmlTable_add_header_above(kable_input, header,
diff --git a/R/add_indent.R b/R/add_indent.R
index 8dc2d4d..886fc1c 100644
--- a/R/add_indent.R
+++ b/R/add_indent.R
@@ -15,7 +15,9 @@
}
kable_format <- attr(kable_input, "format")
if (!kable_format %in% c("html", "latex")) {
- message("Currently generic markdown table using pandoc is not supported.")
+ warning("Please specify format in kable. kableExtra can customize either ",
+ "HTML or LaTeX outputs. See https://haozhu233.github.io/kableExtra/ ",
+ "for details.")
return(kable_input)
}
if (kable_format == "html") {
diff --git a/R/collapse_rows.R b/R/collapse_rows.R
index 1f9d0d3..9feb93d 100644
--- a/R/collapse_rows.R
+++ b/R/collapse_rows.R
@@ -23,7 +23,9 @@
# }
kable_format <- attr(kable_input, "format")
if (!kable_format %in% c("html", "latex")) {
- message("Currently generic markdown table using pandoc is not supported.")
+ warning("Please specify format in kable. kableExtra can customize either ",
+ "HTML or LaTeX outputs. See https://haozhu233.github.io/kableExtra/ ",
+ "for details.")
return(kable_input)
}
if (kable_format == "html") {
diff --git a/R/column_spec.R b/R/column_spec.R
index da8252c..bdd8b2b 100644
--- a/R/column_spec.R
+++ b/R/column_spec.R
@@ -45,7 +45,9 @@
}
kable_format <- attr(kable_input, "format")
if (!kable_format %in% c("html", "latex")) {
- message("Currently generic markdown table using pandoc is not supported.")
+ warning("Please specify format in kable. kableExtra can customize either ",
+ "HTML or LaTeX outputs. See https://haozhu233.github.io/kableExtra/ ",
+ "for details.")
return(kable_input)
}
if (kable_format == "html") {
diff --git a/R/footnote.R b/R/footnote.R
index bb48e0d..066e96f 100644
--- a/R/footnote.R
+++ b/R/footnote.R
@@ -51,7 +51,9 @@
) {
kable_format <- attr(kable_input, "format")
if (!kable_format %in% c("html", "latex")) {
- message("Currently generic markdown table using pandoc is not supported.")
+ warning("Please specify format in kable. kableExtra can customize either ",
+ "HTML or LaTeX outputs. See https://haozhu233.github.io/kableExtra/ ",
+ "for details.")
return(kable_input)
}
if (length(alphabet) > 26) {
diff --git a/R/group_rows.R b/R/group_rows.R
index 7009995..7300eb3 100644
--- a/R/group_rows.R
+++ b/R/group_rows.R
@@ -34,7 +34,9 @@
kable_format <- attr(kable_input, "format")
if (!kable_format %in% c("html", "latex")) {
- message("Currently generic markdown table using pandoc is not supported.")
+ warning("Please specify format in kable. kableExtra can customize either ",
+ "HTML or LaTeX outputs. See https://haozhu233.github.io/kableExtra/ ",
+ "for details.")
return(kable_input)
}
if (is.null(index)) {
diff --git a/R/kable_styling.R b/R/kable_styling.R
index d349120..305d3d0 100644
--- a/R/kable_styling.R
+++ b/R/kable_styling.R
@@ -79,8 +79,10 @@
kable_format <- attr(kable_input, "format")
if (!kable_format %in% c("html", "latex")) {
- message("Currently generic markdown table using pandoc is not supported.")
- return(kable_input)
+ warning("Please specify format in kable. kableExtra can customize either ",
+ "HTML or LaTeX outputs. See https://haozhu233.github.io/kableExtra/ ",
+ "for details.")
+ return(kable_input)
}
if (kable_format == "html") {
if (is.null(full_width)) {
diff --git a/R/landscape.R b/R/landscape.R
index 01ef2bb..d7b3cd1 100644
--- a/R/landscape.R
+++ b/R/landscape.R
@@ -13,7 +13,9 @@
landscape <- function(kable_input, margin = NULL) {
kable_format <- attr(kable_input, "format")
if (!kable_format %in% c("html", "latex")) {
- message("Currently generic markdown table using pandoc is not supported.")
+ warning("Please specify format in kable. kableExtra can customize either ",
+ "HTML or LaTeX outputs. See https://haozhu233.github.io/kableExtra/ ",
+ "for details.")
return(kable_input)
}
if (kable_format == "html") {
diff --git a/R/row_spec.R b/R/row_spec.R
index ee27be7..0d3d74a 100644
--- a/R/row_spec.R
+++ b/R/row_spec.R
@@ -49,7 +49,9 @@
}
kable_format <- attr(kable_input, "format")
if (!kable_format %in% c("html", "latex")) {
- message("Currently generic markdown table using pandoc is not supported.")
+ warning("Please specify format in kable. kableExtra can customize either ",
+ "HTML or LaTeX outputs. See https://haozhu233.github.io/kableExtra/ ",
+ "for details.")
return(kable_input)
}
if (kable_format == "html") {