Skip to content

Commit bab1b3f

Browse files
committed
Ocasio-Cortez
1 parent c22d483 commit bab1b3f

20 files changed

+688
-3268
lines changed

.Rbuildignore

+1
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@
44
^docs$
55
^pkgdown$
66
^\.github$
7+
^README\.Rmd$

DESCRIPTION

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
11
Package: ggaoc
2-
Title: Alexandria Ocasio Cortez inspired ggplots
2+
Title: Alexandria Ocasio-Cortez inspired ggplots
33
Version: 0.0.0.9000
44
Authors@R: c(
55
person("Jordi", "Rosell", , "jroselln@gmail.com", role = c("aut", "cre"),
66
comment = c(ORCID = "0000-0002-4349-1458")),
77
person("Frankie T.", "Hull", , "frankiethull@gmail.com", role = "aut")
88
)
99
Description: The ggaoc package provides a theme, palette, and other useful
10-
functions to customise ggplots and give them a Alexandria Ocasio
11-
Cortez inspired look.
10+
functions to customise ggplots and give them a Alexandria
11+
Ocasio-Cortez inspired look.
1212
License: MIT + file LICENSE
1313
Encoding: UTF-8
1414
Language: en
1515
Roxygen: list(markdown = TRUE)
1616
RoxygenNote: 7.3.2
1717
Depends:
1818
R (>= 4.4)
19-
URL: https://github.com/jrosell/ggaoc, https://jrosell.github.io/ggaoc/
19+
URL: https://github.com/jrosell/ggaoc
2020
Suggests:
2121
devtools,
2222
gapminder,

R/dev.R

+3-3
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
rebuild_package_and_check <- function() {
1010
previous_version <- "0.0.0.9000"
1111
usethis::use_description(list(
12-
"Title" = "Alexandria Ocasio Cortez inspired ggplots",
13-
"Description" = "The ggaoc package provides a theme, palette, and other useful functions to customise ggplots and give them a Alexandria Ocasio Cortez inspired look.",
12+
"Title" = "Alexandria Ocasio-Cortez inspired ggplots",
13+
"Description" = "The ggaoc package provides a theme, palette, and other useful functions to customise ggplots and give them a Alexandria Ocasio-Cortez inspired look.",
1414
"Version" = previous_version,
1515
"Authors@R" = c(
1616
utils::person(
@@ -50,7 +50,7 @@ rebuild_package_and_check <- function() {
5050
)
5151
imports_packages <- c(
5252
"ggplot2",
53-
"showtext"
53+
"showtext"
5454
)
5555
imports_packages |> purrr::walk(
5656
\(x){usethis::use_package(x, type = "Imports"); x}

R/theme-aoc.R

+12-14
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,19 @@
22
#' @export
33
theme_aoc <- \(){
44
if(!requireNamespace("showtext")) {
5-
stop("{showtext] package is requried.")
5+
stop("{showtext} package is requried.")
66
}
7-
library(showtext)
8-
font_add_google("Nunito", "nunito")
9-
font_families()
7+
sysfonts::font_add_google("Nunito", "nunito")
108
ggplot2::theme_minimal(base_family = "nunito") +
119
ggplot2::theme(
1210
legend.position = "none",
13-
axis.text = element_text(color = "grey20"),
14-
axis.title = element_text(color = "grey20"),
15-
axis.line = element_line(color = "grey20"),
16-
panel.grid.minor = element_blank(),
17-
panel.grid.major.x = element_blank(),
18-
panel.grid.major.y = element_line(color = "grey60", linetype = "dashed"),
19-
plot.title = element_text(face = "bold", hjust = 0.5)
11+
axis.text = ggplot2::element_text(color = "grey20"),
12+
axis.title = ggplot2::element_text(color = "grey20"),
13+
axis.line = ggplot2::element_line(color = "grey20"),
14+
panel.grid.minor = ggplot2::element_blank(),
15+
panel.grid.major.x = ggplot2::element_blank(),
16+
panel.grid.major.y = ggplot2::element_line(color = "grey60", linetype = "dashed"),
17+
plot.title = ggplot2::element_text(face = "bold", hjust = 0.5)
2018
)
2119
}
2220

@@ -25,7 +23,7 @@ theme_aoc <- \(){
2523
#' @param ... additional parameters to the labs function
2624
#' @export
2725
labs_aoc <- function(title, ...) {
28-
labs(
26+
ggplot2::labs(
2927
title = toupper(title),
3028
...
3129
)
@@ -35,14 +33,14 @@ labs_aoc <- function(title, ...) {
3533
#' @rdname scale_color_aoc
3634
#' @export
3735
scale_color_aoc <- \() {
38-
scale_color_manual(values = c("darkgreen", "green"))
36+
ggplot2::scale_color_manual(values = c("darkgreen", "green"))
3937
}
4038

4139
#' A labeller function to supply to facet_grid() or facet_wrap() for the argument labeller.
4240
#' @param ... optional parameters to the labeller function
4341
#' @export
4442
labeller_aoc <- function(...) {
45-
labeller(.default = toupper, ...)
43+
ggplot2::labeller(.default = toupper, ...)
4644
}
4745

4846
#' @rdname scale_color_aoc

README.Rmd

+3-3
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,16 @@ knitr::opts_chunk$set(
1313
)
1414
```
1515

16-
# ggaoc
16+
# ggaoc: Alexandria Ocasio-Cortez inspired ggplots
1717

1818
The ggaoc package provides a theme, palette, and other useful functions to
19-
customise ggplots and give them a Alexandria Ocasio Cortez inspired look.
19+
customise ggplots and give them a Alexandria Ocasio-Cortez inspired look.
2020

2121
## Why
2222

2323
All begins with this tweet:
2424

25-
![Plot by Alexandria Ocasio Cortez](man/figures/aoc.jpg)
25+
![Plot by Alexandria Ocasio-Cortez](man/figures/aoc.jpg)
2626

2727

2828
## How

0 commit comments

Comments
 (0)