FRemoved a bunch of prints, str's and cats
This commit is contained in:
10
extract.R
10
extract.R
@@ -1,5 +1,6 @@
|
||||
# R script to upload the existing spreadsheets and homologise them
|
||||
library(magrittr)
|
||||
modules::import(magrittr)
|
||||
|
||||
fList <- list.files("data", pattern = "*.xlsx")
|
||||
|
||||
# Objective to create data tables with
|
||||
@@ -46,7 +47,7 @@ nodeTable <- tibble::tibble()
|
||||
for (wbIdx in 1:length(fList)) {
|
||||
wb <- openxlsx::loadWorkbook(paste0("data/", fList[wbIdx]))
|
||||
hab <- stringr::str_split(fList[wbIdx], "\\.")[[1]][1]
|
||||
# get pressure names
|
||||
|
||||
|
||||
# Drop the time column no use at all....
|
||||
sheet <- openxlsx::readWorkbook(wb, sheet = sheetNames[1])[, -1]
|
||||
@@ -73,6 +74,7 @@ for (wbIdx in 1:length(fList)) {
|
||||
|
||||
# linkCheck("bioassemblages", ba, ba_check)
|
||||
|
||||
|
||||
sheet <- openxlsx::readWorkbook(wb, sheet = sheetNames[4])[, -1]
|
||||
op_check <- na.omit(sheet[, 1:2])
|
||||
sheet2 <- na.omit(sheet[, -c(1, 2)])
|
||||
@@ -82,6 +84,7 @@ for (wbIdx in 1:length(fList)) {
|
||||
|
||||
# linkCheck("outputprocesses", op, op_check)
|
||||
|
||||
|
||||
legend <- openxlsx::readWorkbook(wb, sheet = sheetNames[5])
|
||||
|
||||
nodeType <- c(
|
||||
@@ -91,8 +94,6 @@ for (wbIdx in 1:length(fList)) {
|
||||
rep("ecosystemservice", length(es))
|
||||
)
|
||||
|
||||
|
||||
|
||||
res <- t(sapply(es_nodes[1, ], getNodeVals)) %>% as.data.frame()
|
||||
names(res) <- cleanNames(names(res))
|
||||
res <- res %>% mutate(nodeName = names(res))
|
||||
@@ -109,5 +110,4 @@ for (wbIdx in 1:length(fList)) {
|
||||
mapNewNames <- function() {
|
||||
newNameMap <- openxlsx::read.xlsx("MBA_MESO_Nodes.xlsx") %>%
|
||||
dplyr::select(hab, nodeType, Suggestion, node, newname)
|
||||
save(newNameMap, file = "nameMap.RData")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user