Permalink
Browse files

Update util.R

update file pattern for reading statistics
  • Loading branch information...
ZhangMan1126 committed Dec 10, 2018
1 parent cd6a3dd commit 3181d80d904521534af8310f2c7b7cb889e88509
Showing with 2 additions and 2 deletions.
  1. +2 −2 scripts/util.R
@@ -2,7 +2,7 @@
# Recursively search for all files given the [filePattern] into the given [directory].
# Return a new single table in which all such data is combined together.
# You might specify some columns with [ignoreColumns] if you need to skip them.
gatherAllTables <- function(directory,ignoreColumns=NULL,filePattern="^statistics(\\w|-|_)*\\.csv$"){
gatherAllTables <- function(directory,ignoreColumns=NULL,filePattern="^statistics(\\w|-|_|\\.)*\\.csv$"){
allTables = NULL

for(table in list.files(directory,recursive=TRUE,full.names=TRUE,pattern=filePattern) ){
@@ -34,7 +34,7 @@ gatherAllTables <- function(directory,ignoreColumns=NULL,filePattern="^statistic

# Recursively gather all data from [directory] given the [filePattern] name.
# Output such data in a zipped file with path [zipFile].
gatherAndSaveData <- function(directory,zipFile,ignoreColumns=NULL,filePattern="^statistics(\\w|-|_)*\\.csv$"){
gatherAndSaveData <- function(directory,zipFile,ignoreColumns=NULL,filePattern="^statistics(\\w|-|_|\\.)*\\.csv$"){
cat("Loading data...",date(),"\n")

dt = gatherAllTables(directory,ignoreColumns,filePattern)

0 comments on commit 3181d80

Please sign in to comment.