-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlearning.qmd
71 lines (58 loc) · 1.43 KB
/
learning.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
---
title: "Reproducible documents"
author: "Mudit Chordia"
format: html
---
```{r setup}
#| include: false
library(tidyverse)
nhanes_small <- read_csv(here::here("data/nhanes_small.csv"))
```
## Table of results
```{r mean-age-bmi-table}
#| echo: false
#| warning: false
#| message: false
nhanes_small %>%
filter(!is.na(diabetes)) %>%
group_by(diabetes, education) %>%
summarise(
mean_age = mean(age, na.rm = TRUE),
mean_bmi = mean(bmi, na.rm = TRUE)
) %>%
ungroup() %>%
knitr::kable(caption = "Mean values of Age and BMI for each diabetes and education status")
```
## Prettier table
# Introduction
A quick **brown** fox jumped over the *lazy* dogs
# Methods and Results
## Analysis
```{r prettier-table}
#| echo: false
#| warning: false
#| message: false
nhanes_small %>%
filter(!is.na(diabetes), !is.na(education)) %>%
group_by(diabetes, education) %>%
summarise(
mean_age = mean(age, na.rm = TRUE),
mean_bmi = mean(bmi, na.rm = TRUE)
) %>%
ungroup() %>%
mutate(
mean_age = round(mean_age, 1),
mean_bmi = round(mean_bmi, 1),
education = str_to_sentence(education)
) %>%
rename(
"Diabetes Status" = diabetes,
"Education" = education,
"Mean_Age" = mean_age,
"Mean_BMI" = mean_bmi
) %>%
knitr::kable(caption = "Mean values of Age and BMI for each education and diabetes status.")
```
## Inserting images
{#fig-cat}
Cute kitten in @fig-cat