yaml
Application Exercise
Copy starter files from:
yaml
yaml
yaml
execute: echo: false
in your yaml```{r ref.label=knitr::all_labels()}
#| echo: true
#| eval: false
```
R
, it will print in your output, even if you hide the code with echo: false
. For example:Rows: 150
Columns: 5
$ Sepal.Length <dbl> 5.1, 4.9, 4.7, 4.6, 5.0, 5.4, 4.6, 5.0, 4.4, 4.9, 5.4, 4.…
$ Sepal.Width <dbl> 3.5, 3.0, 3.2, 3.1, 3.6, 3.9, 3.4, 3.4, 2.9, 3.1, 3.7, 3.…
$ Petal.Length <dbl> 1.4, 1.4, 1.3, 1.5, 1.4, 1.7, 1.4, 1.5, 1.4, 1.5, 1.5, 1.…
$ Petal.Width <dbl> 0.2, 0.2, 0.2, 0.2, 0.2, 0.4, 0.3, 0.2, 0.2, 0.1, 0.2, 0.…
$ Species <fct> setosa, setosa, setosa, setosa, setosa, setosa, setosa, s…
results: "hide"
in the chunk options to hide it.```{r}
results: "hide"
glimpse(iris)
```
summary()
function to print tables of our model output.library(gtsummary)
tbl_regression()
function to output a pretty tableCharacteristic | N = 321 |
---|---|
mpg | 19.2 (15.4, 22.8) |
cyl | |
4 | 11 (34%) |
6 | 7 (22%) |
8 | 14 (44%) |
disp | 196 (121, 326) |
hp | 123 (97, 180) |
drat | 3.70 (3.08, 3.92) |
wt | 3.33 (2.58, 3.61) |
qsec | 17.71 (16.89, 18.90) |
vs | 14 (44%) |
am | 13 (41%) |
gear | |
3 | 15 (47%) |
4 | 12 (38%) |
5 | 5 (16%) |
carb | |
1 | 7 (22%) |
2 | 10 (31%) |
3 | 3 (9.4%) |
4 | 10 (31%) |
6 | 1 (3.1%) |
8 | 1 (3.1%) |
1 Median (IQR); n (%) |
R
objectsR
object, p
R
object, p
in a chunk at the beginning of your Appendix```{r}
#| fig-cap: "Scatterplot of Miles per gallon by Displacement"
p
```
citations.bib
file with citations, and then reference them using [@citation]
citations.bib
file in your RStudio projectBibTex
, which is a certain way citations are saved in Latexcitations.bib
is going to be a file with multiple BibTex
entriesBibtex
entries from Google Scholar
"
, click thatBibTex
, which is a certain way citations are saved in Latexcitations.bib
is going to be a file with multiple BibTex
entriesBibtex
entries from Google Scholar
"
, click thatBibTex
on the bottomBibTex
, which is a certain way citations are saved in Latexcitations.bib
is going to be a file with multiple BibTex
entriesBibtex
entries from Google Scholar
"
, click thatBibTex
on the bottomcitations.bib
file in RStudioroumie2017comparative
@article{roumie2017comparative,
title={Comparative safety of sulfonylurea and metformin monotherapy on the risk of heart failure: a cohort study},
author={Roumie, Christianne L and Min, Jea Young and D'Agostino McGowan, Lucy and Presley, Caroline and Grijalva, Carlos G and Hackstadt, Amber J and Hung, Adriana M and Greevy, Robert A and Elasy, Tom and Griffin, Marie R},
journal={Journal of the American Heart Association},
volume={6},
number={4},
pages={e005379},
year={2017},
publisher={Am Heart Assoc}
}
[@roumie2017comparative]
BibTex
object here:print(citation("tidyverse"), bibtex = TRUE)
@Manual{,
title = {tidyverse: Easily Install and Load the 'Tidyverse'},
author = {Hadley Wickham},
year = {2017},
note = {R package version 1.2.1},
url = {https://CRAN.R-project.org/package=tidyverse},
}
[@rstats; @tidyverse]
and then cite the R packages you used.print(citation("tidyverse"), bibtex = TRUE)
@Manual{tidyverse,
title = {tidyverse: Easily Install and Load the 'Tidyverse'},
author = {Hadley Wickham},
year = {2017},
note = {R package version 1.2.1},
url = {https://CRAN.R-project.org/package=tidyverse},
}
[@rstats; @tidyverse; @broom]
and then cite the R packages you used.;
print(citation("broom"), bibtex = TRUE)