Last active
December 19, 2024 23:52
Revisions
-
selfawaresoup revised this gist
Dec 19, 2024 . 1 changed file with 1 addition and 0 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -1,6 +1,7 @@ library(ggplot2) library(dplyr) library(tidyr) library(viridis) interval_plot <- function() { tibble( -
selfawaresoup revised this gist
Dec 19, 2024 . 1 changed file with 4 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -1,3 +1,7 @@ library(ggplot2) library(dplyr) library(tidyr) interval_plot <- function() { tibble( interval = c("Warm-up", "Work", "Recovery", "Work", "Recovery", "Work", "Recovery", "Work", "Recovery", "Work", "Recovery", "Finish"), -
selfawaresoup created this gist
Dec 19, 2024 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,16 @@ interval_plot <- function() { tibble( interval = c("Warm-up", "Work", "Recovery", "Work", "Recovery", "Work", "Recovery", "Work", "Recovery", "Work", "Recovery", "Finish"), "2024-10-21" = c(500, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 500), "2024-12-06" = c(500, 650, 150, 650, 150, 650, 150, 650, 150, 650, 150, 500), "2024-12-11" = c(500, 700, 100, 700, 100, 700, 100, 700, 100, 700, 100, 500) ) |> pivot_longer(cols = starts_with("2024"), names_to = "Date", values_to = "Distance") |> mutate( interval = ordered(interval, levels = c("Warm-up", "Work", "Recovery", "Finish")) ) |> ggplot(aes(x = Distance, y = Date, group = Date, fill = interval)) + geom_bar(stat = "identity") + scale_fill_viridis(discrete = T, option = "rocket", direction = -1) + theme_linedraw() }