Skip to content

Instantly share code, notes, and snippets.

View mylesmharrison's full-sized avatar

Myles Harrison mylesmharrison

View GitHub Profile
# Mandelbrot.R
# Myles Harrison
# everydayanaltics.ca
# -------------------
# "Naive" version
mandelbrot_naive <- function(xmin=-2, xmax=2, nx=500,
ymin=-1.5, ymax=1.5, ny=500,
n=100, showplot=TRUE,
# mandelbrot_vectorized.R
# Myles Harrison
# http://www.everydayanalytics.ca
# parameters
cols <- colorRampPalette(c("blue","yellow","red","black"))(11)
xmin = -2
xmax = 2
nx = 500
ymin = -1.5
# mandelbrot_naive.R
# "Naive" implementation of Mandelbrot Set in R
# Myles Harrison
# http://www.everydayanalytics.ca
# parameters
cols=colorRampPalette(c("blue","yellow","red","black"))(11)
xmin = -2
xmax = 2
nx = 150
@mylesmharrison
mylesmharrison / toronto_datasci_plots.R
Last active August 29, 2015 13:56
Toronto Data Science Group - plots
# Toronto Data Science Group Talk plots
# Myles Harrison
# http://www.everydayanalytics.ca/2014/02/toronto-data-science-group-talk.html
library(hexbin)
library(RColorBrewer)
# Create random data
x <- rnorm(5000, mean=1000)
y <- rnorm(5000, mean=2000)
# Creepypasta.com stories, Votes vs. Rating
# http://www.everydayanalytics.ca/2014/02/creepypasta-learning-ggplot.html
library(ggplot2)
# Read in the data
data <- read.csv(file = 'creepypasta_ratings.csv', header=T, sep=',')
# Base Package
# Plot