Permalink
Browse files

Added optional recursive data directory loading

  • Loading branch information...
1 parent 7349a4e commit d651c7584674d29895dec28f0e93d32b72d3e983 @johnmyleswhite committed Aug 12, 2012
Binary file not shown.
View
@@ -22,6 +22,7 @@ clean.variable.name <- function(variable.name)
variable.name <- gsub('-+', '.', variable.name, perl = TRUE)
variable.name <- gsub('\\s+', '.', variable.name, perl = TRUE)
variable.name <- gsub('\\.+', '.', variable.name, perl = TRUE)
+ variable.name <- gsub('[\\\\/]+', '.', variable.name, perl = TRUE)
variable.name <- make.names(variable.name)
return(variable.name)
}
View
@@ -188,7 +188,22 @@ load.project <- function()
{
stop('You are missing a directory: data')
}
- data.files <- dir('data')
+
+ # If recursive_loading
+ if (is.null(config[['recursive_loading']]))
+ {
+ warning('Your configuration file is missing an entry: recursive_loading')
+ config[['recursive_loading']] <- 'off'
+ }
+
+ if (config[['recursive_loading']] == 'on')
+ {
+ data.files <- dir('data')
+ }
+ else
+ {
+ data.files <- dir('data', recursive = TRUE)
+ }
project.info[['data']] <- c()
for (data.file in data.files)
@@ -1,5 +1,6 @@
data_loading: on
cache_loading: on
+recursive_loading: off
munging: on
logging: off
load_libraries: off
@@ -1,5 +1,6 @@
data_loading: on
cache_loading: on
+recursive_loading: off
munging: on
logging: off
load_libraries: off

0 comments on commit d651c75

Please sign in to comment.