Skip to content

Instantly share code, notes, and snippets.

View cherfychow's full-sized avatar

Cher Chow cherfychow

View GitHub Profile
@cherfychow
cherfychow / BioTIMEpal
Last active June 3, 2022 09:20
BioTIMEpal: ggplot compatible functions for BioTIME palettes
#
# Function to implement BioTIME palettes as scales in ggplot
# Author: Cher Chow
# Updated December 2021 for fill visibility
require(ggplot2)
## BioTIME palettes set up
biotime_palettes <- list(
'realms4' = c("#155f49","#66c1d1","#d9d956","#d17538"),
@cherfychow
cherfychow / cherulean.R
Last active June 22, 2023 08:06
cherulean: custom wrassey palettes
# Cherulean
# Custom palette functions for ggplot, bc hot plots
# Author: Cher Chow
# what do the palettes look like? https://iili.io/HE0wyb9.png
require(ggplot2)
## cherulean palettes set up
## Function if coordinates are ever in degree minutes seconds
# angle input can read these formats
# 00º 00" 00
# 00 00 00
# 00º00"00
angle2dec <- function(angle) {
angle <- as.character(angle)
if (sum(str_detect(angle, '\\s*[:upper:]$')+0) > 0) {
##############################
# Gantt Chart ggplot code
##############################
setwd("Pathnamehere")
source('https://gist.githubusercontent.com/cherfychow/e9ae890fd16f4c86730748c067feee2b/raw/b2db138ab8164c237129308ea643de78cd54b252/cherulean.R')
require(dplyr)
require(ggplot2)
# timeline