#!/usr/bin/env Rscript
root <- "~/projects/Uezu2016"
library(dplyr)
library(data.table)
parts <- c("surprise",
"significance",
"cpm0",
"cpm1",
"rber0",
"rber1",
"rbconfiguration0",
"rbconfiguration1",
"modularity")
# collect filepaths to partition files in root/rdata
parts_files <- sapply(parts, function(x) {
list.files(file.path(root,"rdata"),
pattern=x,
full.names=T)
})
# load
part_list <- lapply(lapply(parts_files, fread, drop=1),unlist)
# examine total number of modules for each method
k <- sapply(part_list,function(x) length(unique(x)))
k %>% t() %>% knitr::kable()
# Make this into a table:
m = c("Surprise","Significance","CPM","RBER","RBConfiguration","Modularity")
k <- list(35,98,c(2,106),c(2,15),c(2,12),12)
df = data.table(Method=m,
`Multi-resolution`=c(F,F,T,T,T,F),
Weighted=c(T,F,T,T,T,T),
Signed=c(F,F,T,F,F,F),k=k)
df <- df %>% arrange(`Multi-resolution`,`Weighted`,`Signed`)
knitr::kable(df,format="latex")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.