Skip to content

Commit

Permalink
fixed overlapping table names bug
Browse files Browse the repository at this point in the history
  • Loading branch information
cklunch committed Jan 23, 2018
1 parent 504f517 commit 298cc2f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions neonDataStackR/R/stackDataFiles.R
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,8 @@ stackDataFiles <- function(folder){
}

if((length(tbltype)==0 && !(tables[i] %in% c("variables","validation"))) || (length(tbltype) > 0 && tbltype == "site-all")){
tblfls <- filepaths[grep(tables[i], filepaths)]
tblnames <- filenames[grep(tables[i], filenames)]
tblfls <- filepaths[grep(paste(".", tables[i], ".", sep=""), filepaths, fixed=T)]
tblnames <- filenames[grep(paste(".", tables[i], ".", sep=""), filenames, fixed=T)]
sites <- unique(substr(tblnames, 10, 13))
sites <- sites[order(sites)]
d <- read.csv(tblfls[grep(sites[1], tblfls)][1], header = T, stringsAsFactors = F)
Expand All @@ -117,8 +117,8 @@ stackDataFiles <- function(folder){


if((length(tbltype)==0 && !(tables[i] %in% c("variables","validation"))) || (length(tbltype) > 0 && tbltype == "site-date")){
tblfls <- filepaths[grep(tables[i], filepaths)]
tblnames <- filenames[grep(tables[i], filenames)]
tblfls <- filepaths[grep(paste(".", tables[i], ".", sep=""), filepaths, fixed=T)]
tblnames <- filenames[grep(paste(".", tables[i], ".", sep=""), filenames, fixed=T)]
d <- read.csv(tblfls[1], header = T, stringsAsFactors = F)
d <- assignClasses(d, variables)
d <- makePosColumns(d, tblnames[1])
Expand Down

0 comments on commit 298cc2f

Please sign in to comment.