Skip to content

Commit

Permalink
Merge branch 'main' into patch-1
Browse files Browse the repository at this point in the history
  • Loading branch information
wjakethompson authored Apr 18, 2024
2 parents 859e0ad + c18765b commit 716e72c
Show file tree
Hide file tree
Showing 71 changed files with 82,974 additions and 82,960 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
R_KEEP_PKG_SOURCE: yes

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- uses: r-lib/actions/setup-pandoc@v2

Expand All @@ -41,9 +41,11 @@ jobs:

- uses: r-lib/actions/setup-r-dependencies@v2
with:
cache-version: 2
extra-packages: any::rcmdcheck
needs: check

- uses: r-lib/actions/check-r-package@v2
with:
upload-snapshots: true
build_args: 'c("--no-manual","--compact-vignettes=gs+qpdf")'
2 changes: 1 addition & 1 deletion .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- uses: r-lib/actions/setup-r@v2
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pkgdown.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- uses: r-lib/actions/setup-pandoc@v2

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-coverage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- uses: r-lib/actions/setup-r@v2
with:
Expand Down
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,4 @@ Encoding: UTF-8
Language: en-US
LazyData: true
Roxygen: list(markdown = TRUE)
RoxygenNote: 7.2.3
RoxygenNote: 7.3.1
5 changes: 3 additions & 2 deletions R/data.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#' Data for Taylor Swift songs
#'
#' A data containing lyrics to and characteristics of all officially
#' A data set containing lyrics to, and characteristics of, all officially
#' released Taylor Swift songs. This includes albums, EPs, and individually
#' released singles.
#'
Expand Down Expand Up @@ -171,6 +171,7 @@
#' * `night`: The show number within each city.
#' * `dress`: The color of the dress Taylor wore on the given night.
#' * `instrument`: The instrument used to play the song (guitar or piano).
#' * `song`: The track name of the song.
#' * `song`: The track name of the primary surprise song.
#' * `mashup`: Additional songs included in a mashup with the primary song.
#' * `guest`: The special guest (if any) that joined Taylor to play the song.
"eras_tour_surprise"
30 changes: 12 additions & 18 deletions R/ggplot2-color-scales.R
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,8 @@ scale_colour_taylor_d <- function(..., alpha = 1, begin = 0, end = 1,
direction = 1, album = "Lover",
aesthetics = "colour") {
ggplot2::discrete_scale(
aesthetics,
"taylor_d",
taylor_pal(alpha, begin, end, direction, album),
aesthetics = aesthetics,
palette = taylor_pal(alpha, begin, end, direction, album),
...
)
}
Expand All @@ -61,9 +60,8 @@ scale_fill_taylor_d <- function(..., alpha = 1, begin = 0, end = 1,
direction = 1, album = "Lover",
aesthetics = "fill") {
ggplot2::discrete_scale(
aesthetics,
"taylor_d",
taylor_pal(alpha, begin, end, direction, album),
aesthetics = aesthetics,
palette = taylor_pal(alpha, begin, end, direction, album),
...
)
}
Expand All @@ -75,9 +73,8 @@ scale_colour_taylor_c <- function(..., alpha = 1, begin = 0, end = 1,
space = "Lab", na.value = "grey50",
guide = "colourbar", aesthetics = "colour") {
ggplot2::continuous_scale(
aesthetics,
"taylor_c",
scales::gradient_n_pal(
aesthetics = aesthetics,
palette = scales::gradient_n_pal(
taylor_pal(alpha, begin, end, direction, album)(6),
values,
space
Expand All @@ -99,9 +96,8 @@ scale_fill_taylor_c <- function(..., alpha = 1, begin = 0, end = 1,
space = "Lab", na.value = "grey50",
guide = "colourbar", aesthetics = "fill") {
ggplot2::continuous_scale(
aesthetics,
"taylor_c",
scales::gradient_n_pal(
aesthetics = aesthetics,
palette = scales::gradient_n_pal(
taylor_pal(alpha, begin, end, direction, album)(6),
values,
space
Expand All @@ -120,9 +116,8 @@ scale_colour_taylor_b <- function(..., alpha = 1, begin = 0, end = 1,
guide = "coloursteps",
aesthetics = "colour") {
ggplot2::binned_scale(
aesthetics,
"taylor_b",
scales::gradient_n_pal(
aesthetics = aesthetics,
palette = scales::gradient_n_pal(
taylor_pal(alpha, begin, end, direction, album)(6),
values,
space
Expand All @@ -144,9 +139,8 @@ scale_fill_taylor_b <- function(..., alpha = 1, begin = 0, end = 1,
space = "Lab", na.value = "grey50",
guide = "coloursteps", aesthetics = "fill") {
ggplot2::binned_scale(
aesthetics,
"taylor_b",
scales::gradient_n_pal(
aesthetics = aesthetics,
palette = scales::gradient_n_pal(
taylor_pal(alpha, begin, end, direction, album)(6),
values,
space
Expand Down
3 changes: 1 addition & 2 deletions R/taylor-package.R
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,9 @@
#'
#' @importFrom ggplot2 waiver
#'
#' @docType package
#' @noRd
#' @name taylor
NULL
"_PACKAGE"

#' Internal vctrs methods
#'
Expand Down
16 changes: 14 additions & 2 deletions data-raw/surprise-songs.R
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,25 @@ eras_tour_surprise <- read_xlsx(here("data-raw", "surprise-songs.xlsx")) %>%


# QC data file -----------------------------------------------------------------
# Check for track names are consistent. Should be 0 rows.
# Check that all past dates have been filled in. Should be 0 rows.
(missing_dates <- eras_tour_surprise %>%
filter(is.na(song)))

# Check that track names are consistent. Should be 0 rows.
(bad_name <- eras_tour_surprise %>%
select(song, mashup) %>%
separate_longer_delim(mashup, delim = "; ") %>%
pivot_longer(cols = everything(), names_to = "type", values_to = "song") %>%
filter(!is.na(song)) %>%
filter(!(song %in% taylor_all_songs$track_name)))

# Check that we're using Taylor's Version when possible. Should be 0 rows.
(not_tv <- eras_tour_surprise %>%
filter(!str_detect(song, fixed("Taylor's Version"))) %>%
select(song, mashup) %>%
separate_longer_delim(mashup, delim = "; ") %>%
pivot_longer(cols = everything(), names_to = "type", values_to = "song") %>%
filter(!is.na(song)) %>%
mutate(tv = map(song,
\(x) {
taylor_all_songs %>%
Expand All @@ -27,7 +39,7 @@ eras_tour_surprise <- read_xlsx(here("data-raw", "surprise-songs.xlsx")) %>%
select(album_name, track_name)
})) %>%
filter(map_lgl(tv, \(x) nrow(x) > 0)) %>%
select(song, tv) %>%
select(type, song, tv) %>%
unnest(tv))

use_data(eras_tour_surprise, overwrite = TRUE)
Binary file modified data-raw/surprise-songs.xlsx
Binary file not shown.
Binary file modified data/eras_tour_surprise.rda
Binary file not shown.
1 change: 1 addition & 0 deletions inst/WORDLIST
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ Metacritic
Midnights
Netlify
Premade
README
Rey
Sheeran's
Spotify
Expand Down
7 changes: 4 additions & 3 deletions man/eras_tour_surprise.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/taylor_songs.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 716e72c

Please sign in to comment.