From 75ac5398fb16dd2d58e8f271646ac8beafe36438 Mon Sep 17 00:00:00 2001 From: addelany Date: Wed, 8 Nov 2023 15:37:37 -0600 Subject: [PATCH] fix null check --- R/build_group_variables.R | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/R/build_group_variables.R b/R/build_group_variables.R index 987ad91..f9641f6 100644 --- a/R/build_group_variables.R +++ b/R/build_group_variables.R @@ -44,13 +44,11 @@ build_group_variables <- function(table_schema, #"/model_id=", model_id, "?endpoint_override=",config$endpoint) - group_var_vector <- paste0('"', paste(group_var_vector, collapse='", "'), '"') - - if (is.null(group_var_vector)){ aws_asset_description <- paste0("Use `arrow` for remote access to the database. This R code will return results for forecasts of the variable by the specific model .\n\n### R\n\n```{r}\n# Use code below\n\nall_results <- arrow::open_dataset(",aws_asset_link,")\ndf <- all_results |> dplyr::collect()\n\n``` \n\nYou can use dplyr operations before calling `dplyr::collect()` to `summarise`, `select` columns, and/or `filter` rows prior to pulling the data into a local `data.frame`. Reducing the data that is pulled locally will speed up the data download speed and reduce your memory usage.\n\n\n") }else{ + group_var_vector <- paste0('"', paste(group_var_vector, collapse='", "'), '"') aws_asset_description <- paste0("Use `arrow` for remote access to the database. This R code will return results for the NEON Ecological Forecasting Aquatics theme.\n\n### R\n\n```{r}\n# Use code below\n\nall_results <- arrow::open_dataset(",aws_asset_link,")\ndf <- all_results |>\n dplyr::filter(variable %in% c(", group_var_vector,")) |>\n dplyr::collect()\n\n``` \n\nYou can use dplyr operations before calling `dplyr::collect()` to `summarise`, `select` columns, and/or `filter` rows prior to pulling the data into a local `data.frame`. Reducing the data that is pulled locally will speed up the data download speed and reduce your memory usage.\n\n\n") }