Skip to content

Instantly share code, notes, and snippets.

Shawn Mollie Taylor mollietaylor

Block or report user

Report or block mollietaylor

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View subfigures.tex
\documentclass{article}
\usepackage{graphicx}
\usepackage{caption}
\usepackage{subcaption}
\begin{document}
\begin{figure}
\centering
View dateFormats.R
# importing dates:
dates <- c("05/27/84", "07/07/05")
betterDates <- as.Date(dates,
format = "%m/%d/%y") # here you put the format your dates are currently in
# it will output the ISO standard dates (%Y-%m-%d)
# or:
dates <- c("May 27 1984", "July 7 2005")
betterDates <- as.Date(dates,
@mollietaylor
mollietaylor / stacked.R
Created Dec 11, 2012
Stacked Bar Charts in R
View stacked.R
# cite: http://stat.ethz.ch/R-manual/R-patched/library/stats/html/reshape.html
# cite: http://www.cs.grinnell.edu/~rebelsky/Courses/MAT115/2008S/R/stacked-bar-graphs.html
# cite: http://www.harding.edu/fmccown/r/#barcharts
library(RColorBrewer)
sequential <- brewer.pal(6, "BuGn")
Loblolly[1:10,]
wide <- reshape(Loblolly,
View map-new-legend.R
library(OIdata)
library(RColorBrewer)
library(classInt)
# load state data from OIdata package:
data(state)
# set constants:
nclr <- 8 # number of bins
min <- 0 # theoretical minimum
@mollietaylor
mollietaylor / lineBreaks.R
Last active Oct 21, 2018
Line Breaks Between Words in Axis Labels in ggplot in R
View lineBreaks.R
library(OIdata)
data(birds)
library(ggplot2)
levels(birds$effect) <- gsub(" ", "\n", levels(birds$effect))
ggplot(birds,
aes(x = effect,
y = speed)) +
geom_boxplot() +
coord_flip()
@mollietaylor
mollietaylor / fit.R
Last active Oct 21, 2018
ggplot or Lattice Fit Line in R
View fit.R
ols <- lm(Temp ~ Solar.R,
data = airquality)
summary(ols)
str(ols)
plot(Temp ~ Solar.R,
data = airquality)
abline(ols)
@mollietaylor
mollietaylor / factorDummies.R
Created Jan 2, 2014
Compare Regression Results to a Specific Factor Level in R
View factorDummies.R
str(ChickWeight$Diet)
table(ChickWeight$Diet)
ols <- lm(weight ~ Time + Diet,
data = ChickWeight)
summary(ols)
ChickWeight$Diet <- relevel(ChickWeight$Diet,
ref = 4)
@mollietaylor
mollietaylor / conventions.csv
Created Sep 8, 2012
Simple word cloud example in R
View conventions.csv
wordper25k democrats republicans
millionaires 7 0
arithmetic 3 0
equal pay 6 0
level playing field 2 0
bin laden 5 0
auto 18 1
fair 13 1
middle class 47 7
forward 33 6
@mollietaylor
mollietaylor / histdens2.R
Created Sep 23, 2012
Adding Measures of Central Tendency to Histograms in R
View histdens2.R
png("beaverhistextra.png")
layout(matrix(c(1:2), 2, 1,
byrow = TRUE))
hist(beaver1$temp, # histogram
col = "peachpuff", # column color
border = "black",
prob = TRUE, # show densities instead of frequencies
xlim = c(36,38.5),
ylim = c(0,3),
xlab = "Temperature",
@mollietaylor
mollietaylor / index.html
Created Jan 22, 2014
Add and Remove Leaflet Circle on Click
View index.html
<!DOCTYPE html>
<meta charset="utf-8">
<html>
<head>
<title>Click Circle</title>
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.6.4/leaflet.css" />
<!--[if lte IE 8]>
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.6.4/leaflet.ie.css" />
<![endif]-->
<script src="http://cdn.leafletjs.com/leaflet-0.6.4/leaflet.js"></script>
You can’t perform that action at this time.