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 characters
| library(tidyverse) | |
| library(ggforce) | |
| bl_gradient <- grid::linearGradient(colours = rev(c("gray40", "#9B9B9B")), | |
| stops = c(0.12, 0.4, 0.6)) | |
| br_gradient <- grid::linearGradient(colours = rev(c("grey10", "#484848")), | |
| x1 = unit(0, "npc"), y1 = unit(0, "npc"), | |
| x2 = unit(1, "npc"), y2 = unit(1, "npc"), | |
| stops = c(0, 0.5, 0.8)) |
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 characters
| library(tidyverse) | |
| library(ggstream) | |
| papers <- readr::read_csv('https://raw.githubusercontent.com/rfordatascience/tidytuesday/master/data/2021/2021-09-28/papers.csv') | |
| programs <- readr::read_csv('https://raw.githubusercontent.com/rfordatascience/tidytuesday/master/data/2021/2021-09-28/programs.csv') | |
| paper_programs <- readr::read_csv('https://raw.githubusercontent.com/rfordatascience/tidytuesday/master/data/2021/2021-09-28/paper_programs.csv') | |
| pp <- programs %>% | |
| mutate(program_category = replace_na(program_category, "Technical")) %>% | |
| left_join(paper_programs) %>% |
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 characters
| library(ggforce) | |
| library(dplyr) | |
| l <- data.frame(a = c(100, 50, 10)) %>% | |
| mutate( | |
| r = sqrt(a/pi), | |
| x0 = 0, | |
| y0 = r | |
| ) |
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 characters
| library(ggplot2) | |
| library(cowplot) | |
| p <- ggplot(mtcars, aes(cyl, disp)) + | |
| geom_point() + | |
| labs(title = "But China and India") + | |
| theme( | |
| plot.background = element_rect(fill = "transparent") | |
| ) |
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 characters
| library(ggfittext) | |
| library(ggplot2) | |
| sensor_data = data.frame( | |
| value = runif(8, min = 0, max = 120), | |
| label = paste0("sensor", 1:8) | |
| ) | |
| ggplot(sensor_data) + | |
| geom_col(aes(x = label, y = value)) + |
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 characters
| --============================== | |
| -- Send Keynote Text to Desktop Markdown File | |
| -- Writted By: Richard Dooling https://github.com/RichardDooling/ | |
| -- Based on | |
| -- Send Keynote Presenter Notes to Evernote | |
| -- Version 1.0.1 | |
| -- Written By: Ben Waldie <[email protected]> | |
| -- http://www.automatedworkflows.com | |
| -- Version 1.0.0 - Initial release |
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 characters
| library(ggplot2) | |
| library(tidyr) | |
| library(viridis) | |
| df <- data.frame(x = 1:10, y = 1:10) %>% expand(x, y) %>% mutate(n = as.integer(runif(min = 0, max = 26, n = 100))) | |
| pal <- c(viridis(n = 23), "black", "purple", "pink") | |
| ggplot(df, aes(x, y, fill = factor(n))) + | |
| geom_tile() + |
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 characters
| library(ggplot2) | |
| library(grid) | |
| myGrob <- grobTree(rectGrob(gp = gpar(fill = "purple", alpha = 0.5))) | |
| ggplot(iris, aes(x = Sepal.Length, y = Petal.Length)) + | |
| geom_point() + | |
| annotation_custom(myGrob, xmin = -10, xmax = -1, ymin = -10, ymax = Inf) + # x axis | |
| annotation_custom(myGrob, xmin = -10, xmax = Inf, ymin = -10, ymax = -1) + # y axis | |
| coord_cartesian(xlim = c(0, 10), ylim = c(0, 10), clip = "off") + |
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 characters
| library(ggplot2) | |
| ggplot(data = data.frame(x = c(-4, 6)), aes(x)) + | |
| stat_function(fun = dnorm, n = 101, args = list(mean = 0, sd = 1), geom = "area", fill = "#F5BB87", alpha = 0.9) + | |
| stat_function(fun = dnorm, n = 101, args = list(mean = 2.7, sd = 1), geom = "area", fill = "#BBD4EB", alpha = 0.9) + | |
| coord_fixed(xlim = c(-5, 7), ratio = 8, clip = "off") + | |
| annotate("segment", x = -3.9, y = 0, xend = 6, yend = 0, color = "grey60", size = 1.3) + | |
| annotate("segment", x = -3.5, y = -0.04, xend = -3.5, yend = 0.42, color = "grey60", size = 1.3) + | |
| annotate("text", x = 0, y = 0.18, label = "what people\nactually do\nin R", family = "Arial Bold", color = "white", size = 5.2) + | |
| annotate("text", x = 2.75, y = 0.18, label = "what people\nassume others\ndo in R", family = "Arial Bold", color = "white", size = 5.2) + |
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 characters
| library(ggforce) | |
| library(ggplot2) | |
| leaf <- data.frame( | |
| x = c(1.6, 1.5, 1.8, 1.5, 1.6, 1.3), | |
| y = c(2, 2, 1.5, 1, 1, 1.5) | |
| ) | |
| ggplot(leaf, aes(x, y)) + | |
| geom_polygon(fill = NA, colour = 'grey') + |
NewerOlder