disable execution of examples for notes on cran
diff --git a/R/add_footnote.R b/R/add_footnote.R
index 49e37cb..469987f 100644
--- a/R/add_footnote.R
+++ b/R/add_footnote.R
@@ -14,8 +14,11 @@
#' @param escape Logical value controlling if the label needs to be escaped.
#' Default is TRUE.
#'
-#' @examples x <- knitr::kable(head(mtcars), "html")
+#' @examples
+#' \dontrun{
+#' x <- knitr::kable(head(mtcars), "html")
#' add_footnote(x, c("footnote 1", "footnote 2"), notation = "symbol")
+#' }
#'
#' @export
add_footnote <- function(input, label = NULL,
diff --git a/R/add_header_above.R b/R/add_header_above.R
index 48fbc3f..49416ff 100644
--- a/R/add_header_above.R
+++ b/R/add_header_above.R
@@ -48,10 +48,13 @@
#' @param border_left T/F option for border on the left side in latex.
#' @param border_right T/F option for border on the right side in latex.
#'
-#' @examples x <- knitr::kable(head(mtcars), "html")
+#' @examples
+#' \dontrun{
+#' x <- knitr::kable(head(mtcars), "html")
#' # Add a row of header with 3 columns on the top of the table. The column
#' # span for the 2nd and 3rd one are 5 & 6.
#' add_header_above(x, c(" ", "Group 1" = 5, "Group 2" = 6))
+#' }
#'
#' @export
add_header_above <- function(kable_input, header = NULL,
diff --git a/R/add_indent.R b/R/add_indent.R
index b433d9d..b53423f 100644
--- a/R/add_indent.R
+++ b/R/add_indent.R
@@ -6,9 +6,12 @@
#' @param level_of_indent a numeric value for the indent level. Default is 1.
#' @param all_cols T/F whether to apply indentation to all columns
#'
-#' @examples x <- knitr::kable(head(mtcars), "html")
+#' @examples
+#' \dontrun{
+#' x <- knitr::kable(head(mtcars), "html")
#' # Add indentations to the 2nd & 4th row
#' add_indent(x, c(2, 4), level_of_indent = 1)
+#' }
#'
#' @export
add_indent <- function(kable_input, positions,
diff --git a/R/collapse_rows.R b/R/collapse_rows.R
index d8b2a51..298c26f 100644
--- a/R/collapse_rows.R
+++ b/R/collapse_rows.R
@@ -34,9 +34,12 @@
#' before the end of a page. If you have a group that is longer than 1 page,
#' you need to turn off this option.
#'
-#' @examples dt <- data.frame(a = c(1, 1, 2, 2), b = c("a", "a", "a", "b"))
+#' @examples
+#' \dontrun{
+#' dt <- data.frame(a = c(1, 1, 2, 2), b = c("a", "a", "a", "b"))
#' x <- knitr::kable(dt, "html")
#' collapse_rows(x)
+#' }
#'
#' @export
collapse_rows <- function(kable_input, columns = NULL,
diff --git a/R/column_spec.R b/R/column_spec.R
index bdc8655..c33461c 100644
--- a/R/column_spec.R
+++ b/R/column_spec.R
@@ -57,10 +57,13 @@
#' customize the column specification. Because of the way it is handled
#' internally, any backslashes must be escaped.
#'
-#' @examples x <- knitr::kable(head(mtcars), "html")
+#' @examples
+#' \dontrun{
+#' x <- knitr::kable(head(mtcars), "html")
#' column_spec(x, 1:2, width = "20em", bold = TRUE, italic = TRUE)
#' x <- knitr::kable(head(mtcars), "latex", booktabs = TRUE)
#' column_spec(x, 1, latex_column_spec = ">{\\\\color{red}}c")
+#' }
#' @export
column_spec <- function(kable_input, column,
width = NULL, bold = FALSE, italic = FALSE,
diff --git a/R/footnote.R b/R/footnote.R
index 59478c3..c2f599a 100644
--- a/R/footnote.R
+++ b/R/footnote.R
@@ -37,8 +37,11 @@
#' @param symbol_manual User can manually supply a vector of either html or
#' latex symbols. For example, `symbol_manual = c('*', '\\\\dag', '\\\\ddag')`.`
#'
-#' @examples dt <- mtcars[1:5, 1:5]
+#' @examples
+#' \dontrun{
+#' dt <- mtcars[1:5, 1:5]
#' footnote(knitr::kable(dt, "html"), alphabet = c("Note a", "Note b"))
+#' }
#'
#' @export
footnote <- function(kable_input,
diff --git a/R/footnote_marker.R b/R/footnote_marker.R
index 72b3306..93ce3d4 100644
--- a/R/footnote_marker.R
+++ b/R/footnote_marker.R
@@ -14,10 +14,13 @@
#' escaped. If you are using footnote_marker in `group_rows`` labeling row or
#' `add_header_above`, you need to set this to be `TRUE`.
#'
-#' @examples dt <- mtcars[1:5, 1:5]
+#' @examples
+#' \dontrun{
+#' dt <- mtcars[1:5, 1:5]
#' colnames(dt)[1] <- paste0("mpg", footnote_marker_alphabet(2, "html"))
#' rownames(dt)[2] <- paste0(rownames(dt)[2], footnote_marker_alphabet(1, "html"))
#' footnote(knitr::kable(dt, "html"), alphabet = c("Note a", "Note b"))
+#' }
#'
#' @export
footnote_marker_number <- function(x, format, double_escape = FALSE) {
diff --git a/R/group_rows.R b/R/group_rows.R
index 8c73143..009226e 100644
--- a/R/group_rows.R
+++ b/R/group_rows.R
@@ -47,9 +47,12 @@
#' @param background A character string for column background color. Here please
#' pay attention to the differences in color codes between HTML and LaTeX.
#'
-#' @examples x <- knitr::kable(head(mtcars), "html")
+#' @examples
+#' \dontrun{
+#' x <- knitr::kable(head(mtcars), "html")
#' # Put Row 2 to Row 5 into a Group and label it as "Group A"
#' pack_rows(x, "Group A", 2, 5)
+#' }
#'
#' @export
group_rows <- function(kable_input, group_label = NULL,
diff --git a/R/kable_styling.R b/R/kable_styling.R
index 10dfb4f..2871ead 100644
--- a/R/kable_styling.R
+++ b/R/kable_styling.R
@@ -82,11 +82,14 @@
#' The LaTeX may not include dollar signs even if they are escaped.
#' Pandoc's rules for recognizing embedded LaTeX are used.
#'
-#' @examples x_html <- knitr::kable(head(mtcars), "html")
+#' @examples
+#' \dontrun{
+#' x_html <- knitr::kable(head(mtcars), "html")
#' kable_styling(x_html, "striped", position = "left", font_size = 7)
#'
#' x_latex <- knitr::kable(head(mtcars), "latex")
#' kable_styling(x_latex, latex_options = "striped", position = "float_left")
+#' }
#'
#' @export
kable_styling <- function(kable_input,
diff --git a/R/landscape.R b/R/landscape.R
index b888131..918e04b 100644
--- a/R/landscape.R
+++ b/R/landscape.R
@@ -7,7 +7,10 @@
#' @param margin Customizable page margin for special needs. Values can be
#' "1cm", "1in" or similar.
#'
-#' @examples landscape(knitr::kable(head(mtcars), "latex"))
+#' @examples
+#' \dontrun{
+#' landscape(knitr::kable(head(mtcars), "latex"))
+#' }
#'
#' @export
landscape <- function(kable_input, margin = NULL) {
diff --git a/R/remove_column.R b/R/remove_column.R
index 3bff2f1..4cc74f4 100644
--- a/R/remove_column.R
+++ b/R/remove_column.R
@@ -7,7 +7,9 @@
#' @export
#'
#' @examples
+#' \dontrun{
#' remove_column(kable(mtcars), 1)
+#' }
remove_column <- function (kable_input, columns) {
if (is.null(columns)) return(kable_input)
kable_format <- attr(kable_input, "format")
diff --git a/R/row_spec.R b/R/row_spec.R
index d056c4a..49b64b6 100644
--- a/R/row_spec.R
+++ b/R/row_spec.R
@@ -34,8 +34,11 @@
#' @param extra_latex_after Extra LaTeX text to be added after the row. Similar
#' with `add.to.row` in xtable
#'
-#' @examples x <- knitr::kable(head(mtcars), "html")
+#' @examples
+#' \dontrun{
+#' x <- knitr::kable(head(mtcars), "html")
#' row_spec(x, 1:2, bold = TRUE, italic = TRUE)
+#' }
#'
#' @export
row_spec <- function(kable_input, row,