Skip to content

Commit

Permalink
quick script to collate csv output of groupedprofileplot by mu
Browse files Browse the repository at this point in the history
  • Loading branch information
brownag committed Aug 17, 2017
1 parent 7328e65 commit 19202ea
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions GroupedProfilePlotByMU/make_lab_pedon_worksheet.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@

csv.path <- "GroupedProfilePlotByMU/csv"
mu.pattern <- "404."
output.name <- "404X"
filez <- list.files(csv.path,recursive=T,full.names = TRUE)
target_files <- grepl(filez, pattern=mu.pattern)
#column names to pull from raw GPP by MU output
colnamz <- c("peiid","pedon_id","bedrckdepth","bedrock_kind","class_type","taxonname","part_size_class","tax_subgroup","ecositeid","musym")

buff <- NULL
for(f in filez[target_files]) {
r <- read.csv(f)
print(names(r))
r <- r[, colnamz]
if(is.null(buff)) {
buff <- r
} else {
buff <- rbind(buff, r)
}
}

buff <- cbind(buff, data.frame(component_office=" ", component_lab=" "))

write.csv(buff, file=paste0("PedonWorksheets/",output.name,".csv"), row.names=FALSE)

0 comments on commit 19202ea

Please sign in to comment.