Skip to content

Instantly share code, notes, and snippets.

View MaximeWack's full-sized avatar

Maxime Wack MaximeWack

View GitHub Profile
@MaximeWack
MaximeWack / Palette
Last active November 28, 2017 13:23
Color/fill functions for ggplot2 with my palette
my_scale_color_discrete <- function(n)
{
pal <- scales::colour_ramp(c("#192440", "#F05440"))
seq(0, 1, length.out = n) %>%
lapply(pal) %>%
unlist -> values
scale_color_manual(values = values, na.value = "#D2D2D2")
}
figures <- function(data, group = NULL)
{
if (is.null(group))
{
names(data) %>%
map(. %>%
{
ggplot(data) +
aes_(x = as.name(.)) -> g
if (is.factor(data[[.]]))
@MaximeWack
MaximeWack / rmdtags.py
Created September 30, 2018 21:26
Tag generator for Rmarkdown files
#! /usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import print_function
help_text = """
Extracts tags from rmd files. Useful for the Tagbar plugin.
Usage:
Install Tagbar (http://majutsushi.github.io/tagbar/). Then, put this file
@MaximeWack
MaximeWack / elmtags.py
Created September 30, 2018 21:52
Tag generator for Elm files
#! /usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import print_function
help_text = """
Extracts tags from Elm files. Useful for the Tagbar plugin.
Usage:
Install Tagbar (http://majutsushi.github.io/tagbar/). Then, put this file