Skip to content

Instantly share code, notes, and snippets.

@kmader
Created October 19, 2016 09:30
Show Gist options
  • Save kmader/82ad8b2325a6c55379831ed00e650a8d to your computer and use it in GitHub Desktop.
Save kmader/82ad8b2325a6c55379831ed00e650a8d to your computer and use it in GitHub Desktop.
Excel MashFest

Install Packages

install.packages(c("xlsx", "dplyr", "plyr"))

Combine everything together

xls_files_to_read <- Sys.glob("../TumorSegmentation/*.xlsx")
print(paste(xls_files_to_read, collapse = ", "))

library(xlsx)
library(plyr) # processing tools
library(dplyr)

# read everything in
all_xls_data <- xls_files_to_read %>% 
  llply(function(in_file) read.xlsx(in_file, sheetIndex = 1)) 

big_mashup <- do.call(rbind.fill,all_xls_data) 

big_mashup %>% 
  write.xlsx("big_mashup.xlsx")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment