Hao Zhu | b1bc0aa | 2015-11-12 11:23:42 -0500 | [diff] [blame] | 1 | #' Add footnote |
| 2 | #' |
| 3 | #' @description Add footnote to your favorite kable output. So far this function |
| 4 | #' only works when you define \code{format} in your kable function or in the |
| 5 | #' global knitr option \code{knitr.table.format}. In latex, we are using the |
| 6 | #' \code{threeparttable} package so you need to import this package in your |
| 7 | #' \code{YAML} header. |
| 8 | #' |
| 9 | #' @param input The direct output of your \code{kable} function or your last |
| 10 | #' \code{kableExtra} function. |
| 11 | #' @param label A vector of footnotes you want to add. You don't need to add |
| 12 | #' notations in your notes. |
| 13 | #' @param notation You can select the format of your footnote notation from |
Hao Zhu | 6a07646 | 2017-03-01 12:59:01 -0500 | [diff] [blame] | 14 | #' `number`, `alphabet` and `symbol`. |
Hao Zhu | f7994dd | 2017-02-27 16:58:42 -0500 | [diff] [blame] | 15 | #' @param threeparttable Boolean value indicating if a |
Hao Zhu | 78e6122 | 2017-05-24 20:53:35 -0400 | [diff] [blame] | 16 | #' \href{https://www.ctan.org/pkg/threeparttable}{threeparttable} scheme should |
| 17 | #' be used. |
Hao Zhu | 245931c | 2017-09-01 22:43:56 -0400 | [diff] [blame] | 18 | #' @param escape Logical value controlling if the label needs to be escaped. |
| 19 | #' Default is TRUE. |
Hao Zhu | 78e6122 | 2017-05-24 20:53:35 -0400 | [diff] [blame] | 20 | #' |
| 21 | #' @examples x <- knitr::kable(head(mtcars), "html") |
| 22 | #' add_footnote(x, c("footnote 1", "footnote 2"), notation = "symbol") |
Hao Zhu | b1bc0aa | 2015-11-12 11:23:42 -0500 | [diff] [blame] | 23 | #' |
| 24 | #' @export |
Hao Zhu | e10cfd3 | 2017-02-21 16:41:14 -0500 | [diff] [blame] | 25 | add_footnote <- function(input, label = NULL, |
Hao Zhu | 9b45a18 | 2017-02-27 18:17:46 -0500 | [diff] [blame] | 26 | notation = "alphabet", |
Hao Zhu | 245931c | 2017-09-01 22:43:56 -0400 | [diff] [blame] | 27 | threeparttable = FALSE, |
| 28 | escape = TRUE) { |
Hao Zhu | e10cfd3 | 2017-02-21 16:41:14 -0500 | [diff] [blame] | 29 | if (is.null(label)) return(input) |
Hao Zhu | 8977a8a | 2015-11-19 16:52:21 -0500 | [diff] [blame] | 30 | |
Hao Zhu | 9b45a18 | 2017-02-27 18:17:46 -0500 | [diff] [blame] | 31 | if (notation == "alphabet") { |
| 32 | notation <- getOption("kable_footnote_notation", "alphabet") |
| 33 | } |
| 34 | if (!threeparttable) { |
| 35 | threeparttable <- getOption("kable_footnote_threeparttable", FALSE) |
| 36 | } |
| 37 | |
| 38 | notation <- match.arg(notation, c("alphabet", "number", "symbol")) |
Hao Zhu | e10cfd3 | 2017-02-21 16:41:14 -0500 | [diff] [blame] | 39 | if (notation == "symbol") { |
| 40 | notation <- paste0(notation, ".", attr(input, "format")) |
Hao Zhu | b1bc0aa | 2015-11-12 11:23:42 -0500 | [diff] [blame] | 41 | } |
Hao Zhu | e10cfd3 | 2017-02-21 16:41:14 -0500 | [diff] [blame] | 42 | |
Hao Zhu | 9b45a18 | 2017-02-27 18:17:46 -0500 | [diff] [blame] | 43 | table_info <- NULL |
| 44 | |
Hao Zhu | e10cfd3 | 2017-02-21 16:41:14 -0500 | [diff] [blame] | 45 | ids.ops <- read.csv(system.file("symbol_index.csv", package = "kableExtra")) |
| 46 | ids <- ids.ops[, notation] |
Hao Zhu | db04e30 | 2015-11-15 16:57:38 -0500 | [diff] [blame] | 47 | ids.intable <- gsub("\\*", "\\\\*", ids) |
| 48 | |
| 49 | #count the number of items in label and intable notation |
Hao Zhu | e10cfd3 | 2017-02-21 16:41:14 -0500 | [diff] [blame] | 50 | count.label <- length(label) |
| 51 | count.intablenote <- sum(str_count(input, "\\[note\\]")) |
Hao Zhu | c541563 | 2017-02-21 17:16:13 -0500 | [diff] [blame] | 52 | if (count.intablenote != 0 & count.label != count.intablenote) { |
Hao Zhu | db04e30 | 2015-11-15 16:57:38 -0500 | [diff] [blame] | 53 | warning(paste("You entered", count.label, "labels but you put", |
Hao Zhu | e10cfd3 | 2017-02-21 16:41:14 -0500 | [diff] [blame] | 54 | count.intablenote, "[note] in your table.")) |
Hao Zhu | db04e30 | 2015-11-15 16:57:38 -0500 | [diff] [blame] | 55 | } |
Hao Zhu | b1bc0aa | 2015-11-12 11:23:42 -0500 | [diff] [blame] | 56 | |
Hao Zhu | 4adea85 | 2015-11-16 16:38:34 -0500 | [diff] [blame] | 57 | export <- input |
| 58 | |
Hao Zhu | dc4b714 | 2015-11-19 10:37:53 -0500 | [diff] [blame] | 59 | # Find out if there are any extra in-table notations needed to be corrected |
Hao Zhu | 2203f66 | 2015-11-20 11:53:39 -0500 | [diff] [blame] | 60 | extra.notation <- unique(as.numeric( |
Hao Zhu | dc4b714 | 2015-11-19 10:37:53 -0500 | [diff] [blame] | 61 | str_extract( |
| 62 | str_extract_all( |
| 63 | paste0(export, collapse = ""), "\\[note[0-9]{1,2}\\]" |
| 64 | )[[1]], |
Hao Zhu | 2203f66 | 2015-11-20 11:53:39 -0500 | [diff] [blame] | 65 | "[0-9]{1,2}"))) |
Hao Zhu | dc4b714 | 2015-11-19 10:37:53 -0500 | [diff] [blame] | 66 | |
Hao Zhu | c541563 | 2017-02-21 17:16:13 -0500 | [diff] [blame] | 67 | # Pandoc --------------------------- |
Hao Zhu | 4adea85 | 2015-11-16 16:38:34 -0500 | [diff] [blame] | 68 | # Footnote solution for markdown and pandoc. It is not perfect as |
| 69 | # markdown doesn't support complex table formats but this solution |
| 70 | # should be able to satisfy people who don't want to spend extra |
Hao Zhu | e10cfd3 | 2017-02-21 16:41:14 -0500 | [diff] [blame] | 71 | # time to define their `kable` format. |
| 72 | if (!attr(input, "format") %in% c("html", "latex")) { |
Hao Zhu | 4adea85 | 2015-11-16 16:38:34 -0500 | [diff] [blame] | 73 | # In table notation |
Hao Zhu | e10cfd3 | 2017-02-21 16:41:14 -0500 | [diff] [blame] | 74 | if (count.intablenote != 0) { |
| 75 | for (i in 1:count.intablenote) { |
| 76 | replace_note <- paste0("^", ids.intable[i], "^", |
Hao Zhu | c541563 | 2017-02-21 17:16:13 -0500 | [diff] [blame] | 77 | paste0(rep(" ", 4 - ceiling(i/5)), collapse = "")) |
Hao Zhu | e10cfd3 | 2017-02-21 16:41:14 -0500 | [diff] [blame] | 78 | |
Hao Zhu | db04e30 | 2015-11-15 16:57:38 -0500 | [diff] [blame] | 79 | export[which(str_detect(export, "\\[note\\]"))[1]] <- |
Hao Zhu | e10cfd3 | 2017-02-21 16:41:14 -0500 | [diff] [blame] | 80 | sub("\\[note\\]", replace_note, |
| 81 | export[which(str_detect(export, "\\[note\\]"))[1]]) |
Hao Zhu | db04e30 | 2015-11-15 16:57:38 -0500 | [diff] [blame] | 82 | } |
Hao Zhu | b1bc0aa | 2015-11-12 11:23:42 -0500 | [diff] [blame] | 83 | } |
Hao Zhu | 4adea85 | 2015-11-16 16:38:34 -0500 | [diff] [blame] | 84 | # Fix extra in table notation |
Hao Zhu | c541563 | 2017-02-21 17:16:13 -0500 | [diff] [blame] | 85 | for (i in extra.notation) { |
Hao Zhu | 4adea85 | 2015-11-16 16:38:34 -0500 | [diff] [blame] | 86 | export <- gsub(paste0("\\[note", i, "\\]"), |
| 87 | paste0("^", ids.intable[i], "^", |
Hao Zhu | c541563 | 2017-02-21 17:16:13 -0500 | [diff] [blame] | 88 | paste0(rep(" ", 4 - ceiling(i/5)), collapse = "")), |
Hao Zhu | 4adea85 | 2015-11-16 16:38:34 -0500 | [diff] [blame] | 89 | export) |
| 90 | } |
Hao Zhu | b1bc0aa | 2015-11-12 11:23:42 -0500 | [diff] [blame] | 91 | |
Hao Zhu | c541563 | 2017-02-21 17:16:13 -0500 | [diff] [blame] | 92 | export[length(export) + 1] <- "" |
| 93 | export[length(export) + 1] <- "__Note:__" |
| 94 | export[length(export) + 1] <- paste0( |
Hao Zhu | db04e30 | 2015-11-15 16:57:38 -0500 | [diff] [blame] | 95 | paste0("^", ids[1:length(label)], "^ ", label), collapse = " " |
Hao Zhu | c541563 | 2017-02-21 17:16:13 -0500 | [diff] [blame] | 96 | ) |
| 97 | } |
Hao Zhu | db04e30 | 2015-11-15 16:57:38 -0500 | [diff] [blame] | 98 | |
Hao Zhu | c541563 | 2017-02-21 17:16:13 -0500 | [diff] [blame] | 99 | # LaTeX Tables -------------------------------- |
| 100 | if (attr(input, "format") == "latex") { |
Hao Zhu | 2203f66 | 2015-11-20 11:53:39 -0500 | [diff] [blame] | 101 | # Clean the entry for labels |
Hao Zhu | 245931c | 2017-09-01 22:43:56 -0400 | [diff] [blame] | 102 | if (escape) { |
| 103 | label <- escape_latex(label) |
| 104 | } |
Hao Zhu | c541563 | 2017-02-21 17:16:13 -0500 | [diff] [blame] | 105 | label <- gsub("\\\\", "\\\\\\\\", label) |
Hao Zhu | 8977a8a | 2015-11-19 16:52:21 -0500 | [diff] [blame] | 106 | |
Hao Zhu | d2c0f73 | 2017-08-26 10:40:14 -0400 | [diff] [blame] | 107 | export <- enc2utf8(export) |
Hao Zhu | 9b45a18 | 2017-02-27 18:17:46 -0500 | [diff] [blame] | 108 | table_info <- magic_mirror(input) |
| 109 | if (table_info$tabular == "longtable") { |
Hao Zhu | c541563 | 2017-02-21 17:16:13 -0500 | [diff] [blame] | 110 | if (notation != "number") { |
| 111 | warning("Notation is set to 'number' and other formats are not supported.") |
| 112 | notation <- "number" |
Hao Zhu | dc4b714 | 2015-11-19 10:37:53 -0500 | [diff] [blame] | 113 | } |
| 114 | # If longtable is used, then use page footnote instead of threeparttable |
| 115 | # as it makes more sense to see the footnote at the bottom of page if |
| 116 | # table is longer than one page. |
Hao Zhu | c541563 | 2017-02-21 17:16:13 -0500 | [diff] [blame] | 117 | if (threeparttable == T) { |
| 118 | warning("Threeparttable does not support longtable.") |
| 119 | threeparttable = F |
| 120 | } |
Hao Zhu | 4adea85 | 2015-11-16 16:38:34 -0500 | [diff] [blame] | 121 | |
Hao Zhu | dc4b714 | 2015-11-19 10:37:53 -0500 | [diff] [blame] | 122 | # Longtable doesn't support footnote in caption directly. |
| 123 | # See http://tex.stackexchange.com/questions/50151/footnotes-in-longtable-captions |
Hao Zhu | c541563 | 2017-02-21 17:16:13 -0500 | [diff] [blame] | 124 | |
| 125 | count.in.caption.note <- 0 |
Hao Zhu | 9b45a18 | 2017-02-27 18:17:46 -0500 | [diff] [blame] | 126 | if (!is.na(table_info$caption)) { |
| 127 | count.in.caption.note <- str_count(table_info$caption, "\\[note\\]") |
Hao Zhu | c541563 | 2017-02-21 17:16:13 -0500 | [diff] [blame] | 128 | } |
| 129 | if (count.in.caption.note != 0) { |
| 130 | caption.footnote <- paste0("\\\\addtocounter{footnote}{-", |
| 131 | count.in.caption.note, "}") |
| 132 | for (i in 1:count.in.caption.note) { |
Hao Zhu | dc4b714 | 2015-11-19 10:37:53 -0500 | [diff] [blame] | 133 | export <- sub("\\[note\\]", "\\\\protect\\\\footnotemark ", export) |
| 134 | caption.footnote <- paste0( |
Hao Zhu | c541563 | 2017-02-21 17:16:13 -0500 | [diff] [blame] | 135 | caption.footnote, "\n\\\\stepcounter{footnote}\\\\footnotetext{", |
| 136 | label[i], "}") |
Hao Zhu | dc4b714 | 2015-11-19 10:37:53 -0500 | [diff] [blame] | 137 | } |
| 138 | |
Hao Zhu | c541563 | 2017-02-21 17:16:13 -0500 | [diff] [blame] | 139 | if (str_detect(export, "\\\\toprule")) { |
Hao Zhu | dc4b714 | 2015-11-19 10:37:53 -0500 | [diff] [blame] | 140 | export <- sub("\\\\toprule", |
| 141 | paste0("\\\\toprule\n", caption.footnote), export) |
Hao Zhu | c541563 | 2017-02-21 17:16:13 -0500 | [diff] [blame] | 142 | } else { |
Hao Zhu | dc4b714 | 2015-11-19 10:37:53 -0500 | [diff] [blame] | 143 | export <- sub("\\\\hline", |
| 144 | paste0("\\\\hline\n", caption.footnote), export) |
| 145 | } |
| 146 | } |
Hao Zhu | c541563 | 2017-02-21 17:16:13 -0500 | [diff] [blame] | 147 | for (i in (count.in.caption.note + 1):count.intablenote) { |
Hao Zhu | 4adea85 | 2015-11-16 16:38:34 -0500 | [diff] [blame] | 148 | export <- sub("\\[note\\]", |
Hao Zhu | dc4b714 | 2015-11-19 10:37:53 -0500 | [diff] [blame] | 149 | paste0("\\\\footnote[", i, "]{", label[i], "}"), export) |
| 150 | } |
Hao Zhu | c541563 | 2017-02-21 17:16:13 -0500 | [diff] [blame] | 151 | for (i in extra.notation) { |
Hao Zhu | dc4b714 | 2015-11-19 10:37:53 -0500 | [diff] [blame] | 152 | export <- gsub(paste0("\\[note", i, "\\]"), |
| 153 | paste0("\\\\footnotemark[", i, "]"), |
| 154 | export) |
Hao Zhu | db04e30 | 2015-11-15 16:57:38 -0500 | [diff] [blame] | 155 | } |
Hao Zhu | c541563 | 2017-02-21 17:16:13 -0500 | [diff] [blame] | 156 | } else { |
Hao Zhu | db04e30 | 2015-11-15 16:57:38 -0500 | [diff] [blame] | 157 | # Replace in-table notation with appropriate symbol |
Hao Zhu | c541563 | 2017-02-21 17:16:13 -0500 | [diff] [blame] | 158 | for (i in 1:count.intablenote) { |
| 159 | export <- sub("\\[note\\]", |
| 160 | paste0("\\\\textsuperscript{", ids.intable[i], "}"), |
| 161 | export) |
Hao Zhu | db04e30 | 2015-11-15 16:57:38 -0500 | [diff] [blame] | 162 | } |
Hao Zhu | b1bc0aa | 2015-11-12 11:23:42 -0500 | [diff] [blame] | 163 | |
Hao Zhu | dc4b714 | 2015-11-19 10:37:53 -0500 | [diff] [blame] | 164 | # Fix extra in table notation |
Hao Zhu | c541563 | 2017-02-21 17:16:13 -0500 | [diff] [blame] | 165 | for (i in extra.notation) { |
Hao Zhu | dc4b714 | 2015-11-19 10:37:53 -0500 | [diff] [blame] | 166 | export <- gsub(paste0("\\[note", i, "\\]"), |
| 167 | paste0("\\\\textsuperscript{", ids.intable[i], "}"), |
| 168 | export) |
Hao Zhu | db04e30 | 2015-11-15 16:57:38 -0500 | [diff] [blame] | 169 | } |
Hao Zhu | c541563 | 2017-02-21 17:16:13 -0500 | [diff] [blame] | 170 | if (threeparttable == T) { |
Hao Zhu | dc4b714 | 2015-11-19 10:37:53 -0500 | [diff] [blame] | 171 | # generate footer with appropriate symbol |
Hao Zhu | f7994dd | 2017-02-27 16:58:42 -0500 | [diff] [blame] | 172 | usepackage_latex("threeparttable") |
Hao Zhu | dc4b714 | 2015-11-19 10:37:53 -0500 | [diff] [blame] | 173 | footer <- "" |
Hao Zhu | c541563 | 2017-02-21 17:16:13 -0500 | [diff] [blame] | 174 | for (i in 1:count.label) { |
Hao Zhu | dc4b714 | 2015-11-19 10:37:53 -0500 | [diff] [blame] | 175 | footer <- paste0(footer,"\\\\item [", ids[i], "] ", label[i], "\n") |
| 176 | } |
| 177 | |
Hao Zhu | c541563 | 2017-02-21 17:16:13 -0500 | [diff] [blame] | 178 | if (grepl("\\\\caption\\{.*?\\}", export)) { |
| 179 | export <- sub("\\\\caption\\{", |
| 180 | "\\\\begin{threeparttable}\n\\\\caption{", |
| 181 | export) |
| 182 | } else { |
Hao Zhu | 245931c | 2017-09-01 22:43:56 -0400 | [diff] [blame] | 183 | export <- sub(paste0("\\\\begin\\{", table_info$tabular, "\\}"), |
| 184 | paste0("\\\\begin{threeparttable}\n\\\\begin{", |
| 185 | table_info$tabular, "}"), |
Hao Zhu | c541563 | 2017-02-21 17:16:13 -0500 | [diff] [blame] | 186 | export) |
Hao Zhu | dc4b714 | 2015-11-19 10:37:53 -0500 | [diff] [blame] | 187 | } |
| 188 | export <- gsub( |
| 189 | "\\\\end\\{tabular\\}", |
Hao Zhu | c541563 | 2017-02-21 17:16:13 -0500 | [diff] [blame] | 190 | paste0("\\\\end{tabular}\n\\\\begin{tablenotes}\n\\\\small\n", |
| 191 | footer, "\\\\end{tablenotes}\n\\\\end{threeparttable}"), |
Hao Zhu | dc4b714 | 2015-11-19 10:37:53 -0500 | [diff] [blame] | 192 | export) |
Hao Zhu | c541563 | 2017-02-21 17:16:13 -0500 | [diff] [blame] | 193 | } else { |
| 194 | table.width <- max(nchar( |
| 195 | str_replace_all( |
Hao Zhu | 9b45a18 | 2017-02-27 18:17:46 -0500 | [diff] [blame] | 196 | str_replace_all(table_info$contents, "\\[note\\]", ""), |
| 197 | "\\[note[0-9]{1,2}\\]", ""))) + 2 * (table_info$ncol - 1) |
Hao Zhu | c541563 | 2017-02-21 17:16:13 -0500 | [diff] [blame] | 198 | footer <- "" |
| 199 | for (i in 1:count.label) { |
| 200 | label.wrap <- strwrap(label[i], table.width) |
Hao Zhu | 9b45a18 | 2017-02-27 18:17:46 -0500 | [diff] [blame] | 201 | footer <- paste0(footer, "\\\\multicolumn{", table_info$ncol, |
Hao Zhu | c541563 | 2017-02-21 17:16:13 -0500 | [diff] [blame] | 202 | "}{l}{\\\\textsuperscript{", ids[i], "} ", |
| 203 | label.wrap[1], "}\\\\\\\\\n") |
| 204 | if (length(label.wrap) > 1) { |
| 205 | for (j in 2:length(label.wrap)) { |
Hao Zhu | 9b45a18 | 2017-02-27 18:17:46 -0500 | [diff] [blame] | 206 | footer <- paste0(footer, "\\\\multicolumn{", table_info$ncol, |
Hao Zhu | c541563 | 2017-02-21 17:16:13 -0500 | [diff] [blame] | 207 | "}{l}{", label.wrap[j], "}\\\\\\\\\n") |
Hao Zhu | dc4b714 | 2015-11-19 10:37:53 -0500 | [diff] [blame] | 208 | } |
| 209 | } |
Hao Zhu | c541563 | 2017-02-21 17:16:13 -0500 | [diff] [blame] | 210 | } |
| 211 | export <- gsub("\\\\end\\{tabular\\}", |
| 212 | paste0(footer, "\\\\end{tabular}"), |
| 213 | export) |
Hao Zhu | dc4b714 | 2015-11-19 10:37:53 -0500 | [diff] [blame] | 214 | } |
Hao Zhu | db04e30 | 2015-11-15 16:57:38 -0500 | [diff] [blame] | 215 | } |
Hao Zhu | b1bc0aa | 2015-11-12 11:23:42 -0500 | [diff] [blame] | 216 | } |
Hao Zhu | c541563 | 2017-02-21 17:16:13 -0500 | [diff] [blame] | 217 | |
| 218 | # HTML Tables ------------------- |
| 219 | if (attr(input, "format") == "html") { |
Hao Zhu | 2203f66 | 2015-11-20 11:53:39 -0500 | [diff] [blame] | 220 | # Clean the entry for labels |
Hao Zhu | 9b45a18 | 2017-02-27 18:17:46 -0500 | [diff] [blame] | 221 | table_info <- magic_mirror(input) |
Hao Zhu | 245931c | 2017-09-01 22:43:56 -0400 | [diff] [blame] | 222 | if (escape) { |
| 223 | label <- escape_html(label) |
| 224 | } |
Hao Zhu | 2203f66 | 2015-11-20 11:53:39 -0500 | [diff] [blame] | 225 | # Replace in-table notation with appropriate symbol |
Hao Zhu | c541563 | 2017-02-21 17:16:13 -0500 | [diff] [blame] | 226 | for (i in 1:count.intablenote) { |
| 227 | export <- sub("\\[note\\]", |
| 228 | paste0("<sup>", ids.intable[i], "</sup>"), |
| 229 | export) |
Hao Zhu | 2203f66 | 2015-11-20 11:53:39 -0500 | [diff] [blame] | 230 | } |
| 231 | |
| 232 | # Fix extra in table notation |
Hao Zhu | c541563 | 2017-02-21 17:16:13 -0500 | [diff] [blame] | 233 | for (i in extra.notation) { |
Hao Zhu | 2203f66 | 2015-11-20 11:53:39 -0500 | [diff] [blame] | 234 | export <- gsub(paste0("\\[note", i, "\\]"), |
| 235 | paste0("<sup>", ids.intable[i], "</sup>"), |
| 236 | export) |
| 237 | } |
| 238 | |
| 239 | # Build footer |
| 240 | footer <- "<tfoot>\n" |
Hao Zhu | c541563 | 2017-02-21 17:16:13 -0500 | [diff] [blame] | 241 | for (i in 1:count.label) { |
Hao Zhu | 2203f66 | 2015-11-20 11:53:39 -0500 | [diff] [blame] | 242 | footer <- paste0(footer, "<tr>\n<td style = 'padding: 0; border:0;' ", |
| 243 | "colspan='100%'><sup>", ids[i],"</sup> ", |
| 244 | label[i], "</td>\n</tr>\n") |
| 245 | } |
| 246 | footer <- paste0(footer, "</tfoot>\n") |
| 247 | |
| 248 | # Paste footer to the table |
| 249 | export[1] <- gsub("</tbody>\n", paste0("</tbody>\n", footer), export[1]) |
Hao Zhu | b1bc0aa | 2015-11-12 11:23:42 -0500 | [diff] [blame] | 250 | } |
Hao Zhu | 32f43f7 | 2017-06-20 18:24:54 -0400 | [diff] [blame] | 251 | attr(export, "kable_meta") <- table_info |
Hao Zhu | b1bc0aa | 2015-11-12 11:23:42 -0500 | [diff] [blame] | 252 | return(export) |
| 253 | } |