From 32a390afa5b4fc68b7d18cb6c9f2ae8c705eb676 Mon Sep 17 00:00:00 2001 From: Jeremy Raw Date: Fri, 17 Apr 2020 12:04:43 -0400 Subject: [PATCH] Added missing function/operator/comparators to VEReports QueryDatastore.R --- sources/modules/VEReports/R/QueryDatastore.R | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/sources/modules/VEReports/R/QueryDatastore.R b/sources/modules/VEReports/R/QueryDatastore.R index ecbc823c6..56fd7a96c 100644 --- a/sources/modules/VEReports/R/QueryDatastore.R +++ b/sources/modules/VEReports/R/QueryDatastore.R @@ -314,7 +314,6 @@ prepareForDatastoreQuery <- function(DstoreLocs_, DstoreType) { # DstoreType = "RD" # ) - #LIST GROUPS #=========== #' Lists the names of groups in model datastores. @@ -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. @@ -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. @@ -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. @@ -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 @@ -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)