Skip to content

Instantly share code, notes, and snippets.

View statnmap's full-sized avatar

Sébastien Rochette statnmap

View GitHub Profile
@statnmap
statnmap / render_toc.R
Last active October 9, 2021 17:40 — forked from gadenbuie/render_toc.R
Generate Manual Table of Contents in (R)Markdown Documents
#' Render Table of Contents
#'
#' A simple function to extract headers from an RMarkdown or Markdown document
#' and build a table of contents. Returns a markdown list with links to the
#' headers using
#' [pandoc header identifiers](http://pandoc.org/MANUAL.html#header-identifiers).
#'
#' WARNING: This function only works with hash-tag headers.
#'
#' Because this function returns only the markdown list, the header for the
@statnmap
statnmap / install-mini.R
Last active April 2, 2019 07:02 — forked from VincentGuyader/install-mini.R
configuration poste R
percent <- function(x, digits = 2, format = "f", ...) {
paste0(formatC(100 * x, format = format, digits = digits, ...), "%")
}
mon_print <- function(synth){
N<-nrow(synth)
if( is.null(N)){
N<-1
synth <-
matrix(synth,nrow=1)