Skip to content

Commit

Permalink
Expand the footnote examples
Browse files Browse the repository at this point in the history
  • Loading branch information
dmurdoch committed Dec 3, 2023
1 parent f7d4ed4 commit b2116eb
Show file tree
Hide file tree
Showing 6 changed files with 41 additions and 8 deletions.
1 change: 1 addition & 0 deletions R/add_footnote.R
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#' @param escape Logical value controlling if the label needs to be escaped.
#' Default is TRUE.
#'
#' @seealso [footnote()], [footnote_marker_number()]
#' @examples
#' \dontrun{
#' x <- knitr::kable(head(mtcars), "html")
Expand Down
11 changes: 10 additions & 1 deletion R/footnote.R
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,19 @@
#' @param symbol_manual User can manually supply a vector of either html or
#' latex symbols. For example, `symbol_manual = c('*', '\\\\dag', '\\\\ddag')`.`
#'
#' @seealso [add_footnote()], [footnote_marker_number()]
#'
#' @examples
#' \dontrun{
#' dt <- mtcars[1:5, 1:5]
#' footnote(knitr::kable(dt, "html"), alphabet = c("Note a", "Note b"))
#' colnames(dt)[1] <- paste0("mpg",
#' footnote_marker_alphabet(2))
#' rownames(dt)[2] <- paste0(rownames(dt)[2],
#' footnote_marker_alphabet(1))
#' dt[1,2] <- paste0(dt[1,2], footnote_marker_alphabet(3))
#'
#' kbl(dt, escape = FALSE) |>
#' footnote(alphabet = c("Note a", "Note b", "Note c"))
#' }
#'
#' @export
Expand Down
11 changes: 8 additions & 3 deletions R/footnote_marker.R
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,14 @@
#' @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"))
#' colnames(dt)[1] <- paste0("mpg",
#' footnote_marker_alphabet(2))
#' rownames(dt)[2] <- paste0(rownames(dt)[2],
#' footnote_marker_alphabet(1))
#' dt[1,2] <- paste0(dt[1,2], footnote_marker_alphabet(3))
#'
#' kbl(dt, escape = FALSE) |>
#' footnote(alphabet = c("Note a", "Note b", "Note c"))
#' }
#'
#' @export
Expand Down
3 changes: 3 additions & 0 deletions man/add_footnote.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 11 additions & 1 deletion man/footnote.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 8 additions & 3 deletions man/footnote_marker_number.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit b2116eb

Please sign in to comment.