-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathR_rmarkdown_template.R
45 lines (39 loc) · 1.04 KB
/
R_rmarkdown_template.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#' ---
#' title: "R skeleton for scripts which can produce HTML output"
#' subtitle: "Rendered using `rmarkdown::render`"
#' author: "Lorenzo Gaborini"
#' date: ""
#' output:
#' html_document:
#' toc: true
#' theme: flatly
#' toc_float:
#' collapsed: false
#' self_contained: false
#' code_folding: show
#' ---
#' \providecommand{\simiid}{~\overset{iid}{\sim}~}
#'
#+ setup, include=FALSE
rm(list = ls())
# Options for knitr
# Remove knitr progressbar
knitr::opts_knit$set(progress = FALSE)
# Enable knitr cache
knitr::opts_chunk$set(cache = TRUE,
clean = FALSE,
autodep = TRUE,
cache.comments = TRUE,
cache.path = 'knitr_cache/',
fig.path = 'knitr_fig/')
# Clear knitr cache
# knitr::opts_chunk$set(cache.rebuild = TRUE)
#' # Title
#'
#' This script can be run within base R, and can be rendered to HTML using `rmarkdown::render("R_rmarkdown_template.R")`.
#'
#' # Code
#+ code
head(iris)
#' ## Subsection
head(iris)