Skip to content

Instantly share code, notes, and snippets.

View vicmansep's full-sized avatar

Victor Manuel Sepulveda Castaneda vicmansep

View GitHub Profile
@vicmansep
vicmansep / gen_lotto
Created June 25, 2019 10:19 — forked from jknowles/gen_lotto
Making lottery numbers that are less likely to results in splitting the winnings.
# Generate lotto numbers
# Avoid a split pot
# Author: Jared Knowles
# Date: 11/26/2012
# All numbers are equally likely to be selected to win in PowerBall,
# but what fun is winning if we have to share the pot?
# Therefore, we will only select numbers that minimize our
# likelihood of sharing the pot.
@vicmansep
vicmansep / ggplot_piper.R
Created May 31, 2019 23:50 — forked from johnDorian/ggplot_piper.R
Piper diagrams using ggplot2.
### A piper diagram based on the ternary plot example here: http://srmulcahy.github.io/2012/12/04/ternary-plots-r.html
### This was written quickly, and most likely contains bugs - I advise you to check it first.
### Jason Lessels [email protected]
### This now consists of two functions. transform_piper_data transforms the data to match
### the coordinates of the piper diagram. ggplot_piper does all of the background.
transform_piper_data <- function(Mg, Ca, Cl,SO4, name=NULL){
if(is.null(name)){