This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(devtools) | |
install_github("mdlincoln/europop") | |
library(europop) | |
library(dplyr) | |
library(rgdal) | |
library(ggplot2) | |
library(animation) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Friends don't let friends use | |
# two spaces after a period | |
sed -e 's/\. /. /g' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<? | |
///////////////////// | |
// slack2html | |
// by @levelsio | |
///////////////////// | |
// | |
///////////////////// | |
// WHAT DOES THIS DO? | |
///////////////////// | |
// |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
convert image -density 300 -units pixelsperinch outimage |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
theme(axis.text.x = element_text(angle = 45, hjust = 1)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
msg <- function(..., prob = 0.25) { | |
if (runif(1) > prob) { | |
return(invisible()) | |
} | |
messages <- c(...) | |
message(sample(messages, 1)) | |
} | |
encourage <- function() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#' Replace all matching values | |
#' | |
#' @param v Vector whose values are to be replaced | |
#' @param pairs A named vector of replacements | |
#' @export | |
#' @examples | |
#' x <- c("a", "a", "b", "c") | |
#' p <- c("a" = "alpha", "b" = "beta") | |
#' replace_each(x, p) | |
replace_each <- function(v, pairs) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
yday_months_x <- scale_x_discrete(breaks = cumsum(c(31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31)), labels = month.name) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
year | nationality | artists_strict | |
---|---|---|---|
1550 | Flemish | 67 | |
1550 | Dutch | 38 | |
1551 | Flemish | 66 | |
1551 | Dutch | 38 | |
1552 | Flemish | 70 | |
1552 | Dutch | 37 | |
1553 | Flemish | 72 | |
1553 | Dutch | 37 | |
1554 | Flemish | 76 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.head.vars as $fields | ($fields | @csv), (.results.bindings[] | [.[$fields[]].value] | @csv) |