From 863c67ae681bbc8d1b4a765ebcf182b6e639fbef Mon Sep 17 00:00:00 2001 From: nicolc11 Date: Thu, 25 Jul 2024 09:56:46 +0100 Subject: [PATCH] Fix for col selecting. --- R/get_simd_postcode.R | 2 +- R/get_spd.R | 2 +- R/read_file.R | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/R/get_simd_postcode.R b/R/get_simd_postcode.R index 382afaf..eda861c 100644 --- a/R/get_simd_postcode.R +++ b/R/get_simd_postcode.R @@ -41,7 +41,7 @@ get_simd_postcode <- function( return(read_file( simd_postcode_path, - col_select = col_select, + col_select = {{ col_select }}, as_data_frame = as_data_frame )) } diff --git a/R/get_spd.R b/R/get_spd.R index 0317936..9869929 100644 --- a/R/get_spd.R +++ b/R/get_spd.R @@ -29,7 +29,7 @@ get_spd <- function( return(read_file( spd_path, - col_select = col_select, + col_select = {{ col_select }}, as_data_frame = as_data_frame )) } diff --git a/R/read_file.R b/R/read_file.R index 55829b0..c287ffd 100644 --- a/R/read_file.R +++ b/R/read_file.R @@ -29,7 +29,7 @@ read_file <- function(path, col_select = NULL, as_data_frame = TRUE, ...) { )) } - if ((!missing(col_select) || !missing(as_data_frame)) && ext != "parquet") { + if ((!rlang::quo_is_missing(rlang::enquo(col_select)) || !missing(as_data_frame)) && ext != "parquet") { cli::cli_abort(c( "x" = "{.arg col_select} and/or {.arg as_data_frame} must only be used when reading a {.field .parquet} file."