Or: “Everybody likes being given a glass of water.”
By Merlin Mann.
It's only advice for you because it had to be advice for me.
genURLS <- function(id, start, end, timeframe = c("hourly", "daily", "monthly")) { | |
years <- seq(start, end, by = 1) | |
nyears <- length(years) | |
timeframe <- match.arg(timeframe) | |
if (isTRUE(all.equal(timeframe, "hourly"))) { | |
years <- rep(years, each = 12) | |
months <- rep(1:12, times = nyears) | |
ids <- rep(id, nyears * 12) | |
} else if (isTRUE(all.equal(timeframe, "daily"))) { | |
months <- 1 # this is essentially arbitrary & ignored if daily |
library(dplyr) | |
library(tidyr) | |
library(magrittr) | |
library(ggplot2) | |
"http://academic.udayton.edu/kissock/http/Weather/gsod95-current/NYNEWYOR.txt" %>% | |
read.table() %>% data.frame %>% tbl_df -> data | |
names(data) <- c("month", "day", "year", "temp") | |
data %>% | |
group_by(year, month) %>% |
# IE is still braindead so still use favicon.ico | |
convert -resize x16 -gravity center -crop 16x16+0+0 -flatten -colors 256 input.png output-16x16.ico | |
convert -resize x32 -gravity center -crop 32x32+0+0 -flatten -colors 256 input.png output-32x32.ico | |
convert output-16x16.ico output-32x32.ico favicon.ico | |
# Then, HTML needs to specify size="XxY" as largest size due to browser bugs | |
<link rel="shortcut icon" href="/favicon.ico" sizes="32x32"> |
library(maps) | |
library(geosphere) | |
library(plyr) | |
library(ggplot2) | |
library(sp) | |
airports <- read.csv("http://www.stanford.edu/~cengel/cgi-bin/anthrospace/wp-content/uploads/2012/03/airports.csv", as.is=TRUE, header=TRUE) | |
flights <- read.csv("http://www.stanford.edu/~cengel/cgi-bin/anthrospace/wp-content/uploads/2012/03/PEK-openflights-export-2012-03-19.csv", as.is=TRUE, header=TRUE) | |
# aggregate nunber of flights |