I hereby claim:
- I am mdlincoln on github.
- I am mdlincoln (https://keybase.io/mdlincoln) on keybase.
- I have a public key whose fingerprint is 5271 D84C 193A 4B9B 945C D4AA D3AB 2911 2CAD 6E14
To claim this, I am signing this object:
row_rep <- function(df, n) { | |
df[rep(1:nrow(df), times = n),] | |
} |
<? | |
///////////////////// | |
// slack2html | |
// by @levelsio | |
///////////////////// | |
// | |
///////////////////// | |
// WHAT DOES THIS DO? | |
///////////////////// | |
// |
# Friends don't let friends use | |
# two spaces after a period | |
sed -e 's/\. /. /g' |
library(devtools) | |
install_github("mdlincoln/europop") | |
library(europop) | |
library(dplyr) | |
library(rgdal) | |
library(ggplot2) | |
library(animation) |
library(ggplot2) | |
library(dplyr) | |
library(animation) | |
load(url("http://matthewlincoln.net/assets/docs/sim_data.rda")) | |
saveGIF({ | |
# We want one frame per replication | |
for(i in 1:max(bm_raw_sims$r)) { |
doc_data <- function(d) { | |
# Get column names and types | |
vartype <- vapply(d, typeof, FUN.VALUE = character(1)) | |
# Write individual item description templates | |
items <- paste0("#\' \\item{\\code{", names(vartype), "}}{", vartype, ". ###}", collapse = "\n") | |
# Return the full documentation template | |
paste0("#\' DATASET TITLE | |
#\' |
city | coordinates | |
---|---|---|
'S HERTOGENBOSCH | 51.69917,5.30417 | |
AACHEN | 50.77664,6.08342 | |
AALST | 50.93604,4.0355 | |
ABBEVILLE | 50.1,1.83333 | |
ABERDEEN | 57.14369,-2.09814 | |
ACIREALE | 37.60666,15.16279 | |
AGEN | 44.2,0.63333 | |
AIX EN PROVENCE | 43.5283,5.44973 | |
ALBI | 43.9298,2.148 |
library(igraph) | |
library(dplyr) | |
# Assume you have a dataframe "objects" with columns "object_id", "artist_id", "date" | |
# Create an identical table that just gives a new variable name to "artist_id" | |
flipped_objects <- objects %>% rename(artist_id = artist2_id) | |
# Join the tables together (essentially joining objects to itself, creating every combination | |
# of artist that share an object_id and date | |
edges <- objects %>% |
I hereby claim:
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object: