Skip to content

Instantly share code, notes, and snippets.

@erikerhardt
Last active July 24, 2023 16:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save erikerhardt/5fedcba08c57a96dc87d0b6acd785163 to your computer and use it in GitHub Desktop.
Save erikerhardt/5fedcba08c57a96dc87d0b6acd785163 to your computer and use it in GitHub Desktop.
quarto_table_figure_captions_template
# https://quarto.org/docs/authoring/tables.html
```{r}
#| label: tbl-example
#| tbl-cap: "Example caption can
#| continue on the next line"
#| tbl-subcap:
#| - "Cars"
#| - "Pressure"
#| layout-ncol: 2
#| echo: fenced
library(knitr)
kable(head(cars))
kable(head(pressure))
```
# https://quarto.org/docs/authoring/tables.html
```{r}
#| label: tbl-example
#| tbl-cap: "Example caption can
#| continue on the next line"
#| tbl-subcap: true # empty (a), (b) labels
#| layout-ncol: 2
#| echo: fenced
library(knitr)
kable(head(cars))
kable(head(pressure))
```
```{r}
#| label: fig-PNC-fig1_15
#| fig-cap: "Histograms of daily KWH data for different time periods. From left
#| to right, the data are for the periods October 17-December 5, 1993; December 6,
#| 1993-January 24, 1994; January 25-March 15, 1994; and March 16-May 6, 1994."
dat_elece <-
dat_elece
p <- ggplot(data = dat_elece, aes(x = KWH))
p <- p + geom_histogram(boundary = 0, binwidth = 5)
p <- p + coord_flip()
p <- p + facet_grid(. ~ period)
p
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment