-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: Adam H. Sparks <adam.sparks@curtin.edu.au>
- Loading branch information
1 parent
3cc108c
commit 3003f02
Showing
9 changed files
with
154 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,139 @@ | ||
--- | ||
title: "AAGI" | ||
author: "Analytics for the Australian Grain Industry" | ||
date: last-modified | ||
format: | ||
aagi-pptx: default | ||
--- | ||
|
||
```{r} | ||
#| label: load | ||
#| message: false | ||
if (!require("pak")) install.packages("pak") | ||
if (!require("AAGIPalettes")) { | ||
pak::pkg_install("AAGI-AUS/AAGIPalettes") | ||
} | ||
if (!require("AAGIThemes")) { | ||
pak::pkg_install("AAGI-AUS/AAGIThemes") | ||
} | ||
if (!require("gapminder")) { | ||
pak::pkg_install("gapminder") | ||
} | ||
library(ggplot2) | ||
library(AAGIThemes) | ||
# set ggplot2 theme | ||
theme_set(theme_aagi()) | ||
``` | ||
|
||
## An AAGI pptx Theme for Quarto | ||
|
||
This Quarto extension allows you to create your slides using a theme that follows AAGI typography and colour styles and provides the official AAGI logo and cover image for the title slide. | ||
|
||
## Bullet point | ||
|
||
- Point 1 | ||
- Point 2 | ||
|
||
## Tables | ||
|
||
For tables, we suggest paring with the R package [{AAGIThemes}](https://github.com/AAGI-AUS/AAGIThemes) to provide AAGI themed tables using `theme_ft_aagi`, that offers more flexibility in formatting. | ||
|
||
## Example | ||
|
||
```{r} | ||
#| label: tab-AAGI | ||
#| message: false | ||
#| echo: false | ||
library(dplyr) | ||
library(flextable) | ||
library(AAGIThemes) | ||
# set flextable theme | ||
set_flextable_defaults( | ||
theme_fun = theme_ft_aagi | ||
) | ||
flex_tab <- flextable(head(airquality) |> | ||
mutate(`Month Name` = "May")) |> | ||
autofit() | ||
flex_tab | ||
``` | ||
|
||
## Basic Figures | ||
|
||
[{AAGIThemes}](https://github.com/AAGI-AUS/AAGIThemes) also provides support for theming basic figures in R, for example. | ||
|
||
```{r} | ||
#| label: graphics-figure | ||
#| message: false | ||
library(AAGIThemes) | ||
plot_aagi(pressure) | ||
``` | ||
|
||
## Figures with {ggplot2} | ||
|
||
[{AAGIThemes}](https://github.com/AAGI-AUS/AAGIThemes) also provides support for theming [{ggplot2}](https://ggplot2.tidyverse.org) outputs in R, for example. | ||
|
||
```{r} | ||
#| label: ggplot2-figure | ||
#| message: false | ||
#Prepare data | ||
library(gapminder) | ||
library(dplyr) | ||
library(ggplot2) | ||
library(AAGIThemes) | ||
facet <- gapminder |> | ||
filter(continent != "Americas") |> | ||
group_by(continent, year) |> | ||
summarise(pop = sum(as.numeric(pop))) | ||
#> `summarise()` has grouped output by 'continent'. You can override using the | ||
#> `.groups` argument. | ||
col_values <- c( | ||
AAGIPalettes::colour_as_hex("AAGI Teal"), | ||
AAGIPalettes::colour_as_hex("AAGI Green"), | ||
AAGIPalettes::colour_as_hex("AAGI Yellow"), | ||
AAGIPalettes::colour_as_hex("AAGI Blue") | ||
) | ||
#Make plot | ||
ggplot() + | ||
geom_area(data = facet, aes(x = year, y = pop, fill = continent)) + | ||
scale_fill_manual(values = col_values) + | ||
facet_wrap(~ continent, ncol = 5) + | ||
scale_y_continuous(breaks = c(0, 2000000000, 4000000000), | ||
labels = c(0, "2bn", "4bn")) + | ||
theme_aagi() + | ||
geom_hline(yintercept = 0, | ||
linewidth = 1, | ||
colour = "#474747") + | ||
theme(legend.position = "none", axis.text.x = element_blank()) + | ||
labs(title = "Asia's rapid growth", subtitle = "Population growth by continent, 1952-2007") | ||
``` | ||
|
||
## Slides With Columns | ||
|
||
::::: columns | ||
::: {.column width="50%"} | ||
This is a column on the left. | ||
::: | ||
|
||
::: {.column width="50%"} | ||
This is a column on the right. | ||
::: | ||
::::: | ||
|
||
# Thank You | ||
|
||
<!-- Uncomment if you have a bibliography | ||
## References | ||
--> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters