Skip to content

Commit

Permalink
Merge pull request #33 from addelany/main
Browse files Browse the repository at this point in the history
fix the null check for group values generation
  • Loading branch information
addelany authored Nov 8, 2023
2 parents 40a9e64 + ab0e64e commit ba13de6
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions R/build_group_variables.R
Original file line number Diff line number Diff line change
Expand Up @@ -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")
}
Expand Down

0 comments on commit ba13de6

Please sign in to comment.