-
Notifications
You must be signed in to change notification settings - Fork 0
/
template.qmd
141 lines (107 loc) · 2.92 KB
/
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
---
title: NEUROCOGNITIVE EXAMINATION
name: {{< var first_name >}} {{< var last_name >}}
doe: today
patient: Biggie
---
```{r}
#| label: setup
#| include: false
#| cache: false
packages <- c(
"dplyr",
"collapse",
"glue",
"gt",
"here",
"janitor",
"knitr",
"quarto",
"readr",
"readxl",
"rmarkdown",
"snakecase",
"tidytable",
"vroom",
"xfun",
"bwu"
)
# Function to load packages one by one
load_packages <- function(packages2) {
for (pkg in packages) {
if (!require(pkg, character.only = TRUE)) {
install.packages(pkg)
library(pkg, character.only = TRUE)
}
message(paste("Loaded package:", pkg))
}
}
# Call the function to load packages
load_packages(packages)
# Set knitr options
knitr::opts_knit$set(width = 80, digits = 2, warnPartialMatchArgs = FALSE)
knitr::knit_hooks$set(crop = knitr::hook_pdfcrop)
knitr::knit_hooks$set(optipng = knitr::hook_optipng)
# Check if the output format is LaTeX
if (identical(knitr:::pandoc_to(), "latex")) {
knit_hooks$set(plot = function(x, options) {
# Adjust here with whatever you need to do with your plots for LaTeX output
paste("\\begin{figure}[htbp!]",
"\\centering",
"\\includegraphics[width=\\maxwidth]{", x, "}",
"\\caption{", options$fig.cap, "}",
"\\end{figure}",
sep = "\n"
)
})
}
# Set environment variables with default values
Sys.setenv(PATIENT = "{{< var patient >}}", RETURN_PLOT = TRUE)
patient <- Sys.getenv("PATIENT")
return_plot <- Sys.getenv("RETURN_PLOT")
```
```{r}
#| label: data-load
#| include: false
file_path <- here::here("data", "csv")
bwu::load_data(here::here(file_path))
neurocog <- vroom::vroom("neurocog.csv")
neurobehav <- vroom::vroom("neurobehav.csv")
neuropsych <- vroom::vroom("neuropsych.csv")
validity <- vroom::vroom("validity.csv")
```
```{=typst}
#let name = [{{< var first_name >}} {{< var last_name >}}]
#let doe = [2024-01-01]
#let patient = [{{< var patient >}}]
#v(2em, weak: true)
#show block: set par(leading: 0.65em)
#block[
*PATIENT NAME:* #name \
*DATES OF EXAM:* {{< var doe1 >}}, {{< var doe2 >}}, and {{< var doe3 >}} \
]
```
{{< include _00-00_tests.qmd >}}
<!-- {{< pagebreak >}} -->
{{< include _01-00_nse.qmd >}}
<!-- {{< pagebreak >}} -->
# NEUROCOGNITIVE FINDINGS {#sec-nt}
{{< include _02-00_behav-obs.qmd >}}
{{< include _02-01_iq.qmd >}}
{{< include _02-02_academics.qmd >}}
{{< include _02-03_verbal.qmd >}}
{{< include _02-04_spatial.qmd >}}
{{< include _02-05_memory.qmd >}}
{{< include _02-06_executive.qmd >}}
<!-- {{< include _02-07_motor.qmd >}} -->
<!-- {{< include _02-08_social.qmd >}} -->
{{< include _02-09_adhd_child.qmd >}}
{{< include _02-10_emotion_child.qmd >}}
<!-- {{< include _02-11_adaptive.qmd >}} -->
<!-- {{< pagebreak >}} -->
{{< include _03-00_sirf.qmd >}}
{{< include _03-00_sirf_text.qmd >}}
{{< include _03-01_recs.qmd >}}
{{< include _03-02_signature.qmd >}}
{{< pagebreak >}}
{{< include _03-03_appendix.qmd >}}