Verifying that +thomasp85 is my blockchain ID. https://onename.com/thomasp85
This file contains hidden or 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(tweenr) # Available on CRAN | |
library(ggforce) # Install from thomasp85/ggforce | |
library(gganimate) # Install from dgrtwo/gganimate | |
set.seed(2) | |
x <- sample(9,20, prob=c(1,2,3,4,5,4,3,2,1), replace=T) | |
df <- data.frame(x = x, y = 15) | |
dfs <- list(df) | |
for(i in seq_len(nrow(df))) { | |
dftemp <- tail(dfs, 1) | |
dftemp[[1]]$y[i] <- sum(dftemp[[1]]$x[seq_len(i)] == dftemp[[1]]$x[i]) |
This file contains hidden or 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
#devtools::install_github('thomasp85/ggforce') | |
#devtools::install_github("dgrtwo/gganimate") | |
#devtools::install_github('thomasp85/ggraph') | |
#devtools::install_github("hadley/ggplot2") | |
library(ggraph) | |
library(ggforce) | |
library(gganimate) | |
library(ggplot2) | |
library(igraph) |
This file contains hidden or 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(ggraph) | |
library(gganimate) | |
library(igraph) | |
# Data from http://konect.uni-koblenz.de/networks/sociopatterns-infectious | |
infect <- read.table('out.sociopatterns-infectious', skip = 2, sep = ' ', stringsAsFactors = FALSE) | |
infect$V3 <- NULL | |
names(infect) <- c('from', 'to', 'time') | |
infect$timebins <- as.numeric(cut(infect$time, breaks = 100)) | |
# We want that nice fading effect so we need to add extra data for the trailing |
NewerOlder