#------------------------------------------------------------------------------------------------------ #-----------------------------Parser Excel - ISO survey------------------------------------------------ #------------------------------------------------------------------------------------------------------ #-----------------------------Library tests / install-------------------------------------------------- #' Install and load required libraries #' #' This function checks if every required library is installed to be loaded, if not they will be installed and then loaded. #' Libraries installed: #' xlsx to parse excel files like ISO survey source format LoadParserLibraries <- function(){ if (!require("xlsx")) { install.packages("xlsx") if (!require("xlsx")) stop("Error while loading package [xlsx]") } } #----------------------------- ParseHMExcel <- function(file){ print(file) if (!file.exists(file)) { stop(paste("Error, file [", file, "] not found")) } dataset <- read.xlsx2(file, 1, header = TRUE,colIndex = 2:10) dataset } ParseHMFolder <- function(folder){ filelist <- list.files(folder) frames <- lapply(paste(folder,filelist,sep=""),ParseHMExcel) merged_frame = merge(frames) merged_frame }