-
Notifications
You must be signed in to change notification settings - Fork 1
/
report_template.qmd
154 lines (124 loc) · 3.34 KB
/
report_template.qmd
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
---
title: "Report Title"
date: "`r Sys.Date()`"
author: Your Name
date-format: "D MMMM YYYY"
format:
html:
# Table of Contents options
toc: true
toc-depth: 3
toc-location: left
toc-title: Contents
number-sections: false
number-depth: 3
# Render options
theme: cosmo
css: NHS_report_theme.css
anchor-sections: false
html-math-method: katex
# Code options
code-tools:
source: false
toggle: false
caption: none
# code-fold: false
# code-summary: "Show code"
embed-resources: true
standalone: true
# URL options
link-external-icon: true
link-external-newwindow: true
# Reference options
citations-hover: true
footnotes-hover: true
# Callout options
callout-appearance: simple
callout-collapse: true
# Caption options
cap-location: bottom
# Title options
title-block-banner: '#005EB8'
backgroundcolor: '#f0f4f5'
# Set font
mainfont: 'Open Sans'
execute:
echo: false
crossref:
fig-title: '**Figure**'
fig-labels: arabic
---
```{r load library}
#| include: false
# Add librires required here
# -------------------------------------------------------------------------
install_and_load_packages <- function(packages, github_packages) {
for(package in packages) {
if (!require(package, character.only = TRUE)) {
install.packages(package, repos = "https://cran.r-project.org", dependencies = TRUE)
library(package, character.only = TRUE)
}
}
if (!requireNamespace("remotes", quietly = TRUE)) {
install.packages("remotes", repos = "https://cran.r-project.org", dependencies = TRUE)
}
for(github_path in github_packages) {
package <- strsplit(github_path, "/")[[1]][2]
if (!require(package, character.only = TRUE)) {
remotes::install_github(github_path)
library(package, character.only = TRUE)
}
}
}
packages <- c("ggplot2")
github_packages <- NULL
suppressPackageStartupMessages(install_and_load_packages(packages, github_packages))
# Define any functions here
# -------------------------------------------------------------------------
```
# H1 Title
Text.
<!-- start of chart tabset -->
:::: panel-tabset
<!-- make new tabs with ## -->
## Chart Tab
```{r}
# Add your chart here
#-------------------------------------------------------
# Load the mtcars dataset
data(mtcars)
# Create a basic ggplot chart with mtcars data
basic_ggplot <- ggplot(mtcars, aes(x = wt, y = mpg)) +
geom_point() + # Add points to the plot
labs(title = "Miles per Gallon vs. Weight",
x = "Weight (1000 lbs)",
y = "Miles per Gallon") # Add labels to the plot
# Display the chart
print(basic_ggplot)
```
<!-- make new tabs with ## -->
## Data Table Tab
```{r}
# Add your table here
#-------------------------------------------------------
# Load the mtcars dataset
data(mtcars)
# Display the first 6 rows of the dataset as a table
mtcars_table <- head(mtcars, 10)
# Print the table
print(mtcars_table)
```
::::
<!-- end of chart tabset -->
## H2 Title
### H3 Title
Text.
::: {.callout-note}
## Callout section
There are [five different types of callouts available](https://quarto.org/docs/authoring/callouts.html#callout-types).
- note `{.callout-note}`
- warning `{.callout-warning}`
- important `{.callout-important}`
- tip `{.callout-tip}`
- caution `{.callout-caution}`
:::