Skip to content

Commit

Permalink
Added missing function/operator/comparators to VEReports QueryDatasto…
Browse files Browse the repository at this point in the history
…re.R
  • Loading branch information
jrawbits committed Apr 17, 2020
1 parent d8a7a60 commit 32a390a
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions sources/modules/VEReports/R/QueryDatastore.R
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,6 @@ prepareForDatastoreQuery <- function(DstoreLocs_, DstoreType) {
# DstoreType = "RD"
# )


#LIST GROUPS
#===========
#' Lists the names of groups in model datastores.
Expand Down Expand Up @@ -347,7 +346,6 @@ listGroups <- function(QueryPrep_ls) {
# )
# listGroups(QPrep_ls)


#LIST TABLES IN GROUP
#====================
#' List names of tables in a group in a datastore.
Expand Down Expand Up @@ -385,7 +383,6 @@ listTables <- function(Group, QueryPrep_ls) {
# print(listTables(grp, QPrep_ls))
# }


#LIST DATASETS IN GROUP
#======================
#' List names and descriptions datasets in a table in a datastore.
Expand Down Expand Up @@ -440,7 +437,6 @@ listDatasets <- function(Table, Group, QueryPrep_ls) {
# )
# listDatasets("Household", "2010", QPrep_ls)


#CREATE DOCUMENTATION OF DATASETS IN A DATASTORE
#===============================================
#' Save an zip archive which documents all tables/datasets in a datastore.
Expand Down Expand Up @@ -495,7 +491,6 @@ documentDatastoreTables <- function(SaveArchiveName, QueryPrep_ls) {
# documentDatastoreTables("Datastore_Documentation", QPrep_ls)
# rm(QPrep_ls)


#READ MULTIPLE DATASETS FROM DATASTORES
#======================================
#' Read multiple datasets from multiple tables in datastores
Expand Down Expand Up @@ -766,9 +761,9 @@ summarizeDatasets <-
wtmean <- function(x, w) sum(x * w) / sum(w)
#Identify whether symbol is an operand
isOperand <- function(Symbol) {
Functions_ <- c("sum", "count", "mean", "wtmean", "max", "min", "median")
Operators_ <- c("+", "-", "*", "/")
Comparators_ <- c("==", ">=", "<=", "!=", ">", "<", "&", "|")
Functions_ <- c("sum", "count", "mean", "wtmean", "max", "min", "median", "c")
Operators_ <- c("+", "-", "*", "/", "%in%")
Comparators_ <- c("==", ">=", "<=", "!=", ">", "<", "&", "|", "!")
Group_ <- c("(", ")", "[", "]")
NonOperands_ <- c(Functions_, Operators_, Comparators_, Group_)
!(deparse(Symbol) %in% NonOperands_) & !is.character(Symbol) & !is.numeric(Symbol) & !is.logical(Symbol)
Expand Down

0 comments on commit 32a390a

Please sign in to comment.