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(ggraph) | |
library(tidygraph) | |
library(gganimate) | |
# 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$time <- as.POSIXct(infect$time, origin = Sys.time() - as.numeric(Sys.time())) |
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
create_big_data_from_csv_dir <- function(directory, ids) { | |
# locate the files | |
files <- list.files(directory, full.names=T)[ids] | |
# read the files into a list of data.frames | |
data.list <- lapply(files, read.csv) | |
# concatenate into one big data.frame | |
data.cat <- do.call(rbind, data.list) | |