From 1bdbb0df9436e93c1f4dd6b6c84ca22886a3a501 Mon Sep 17 00:00:00 2001 From: Andreas Gammelgaard Damsbo Date: Tue, 9 Apr 2024 10:51:31 +0200 Subject: [PATCH] fix read_redcap_tables --- NEWS.md | 6 +++++- R/read_redcap_tables.R | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/NEWS.md b/NEWS.md index c569de6..e03e4f1 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,4 +1,8 @@ -# REDCapCAST 24.3.1 - in development +# REDCapCAST 24.4.1 - in development + +### Functions + +* Fix: `read_redcap_tables()`: field names testing allows to include "[form_name]_complete" fields. ### Documentation and more diff --git a/R/read_redcap_tables.R b/R/read_redcap_tables.R index d970bdc..a8deab2 100644 --- a/R/read_redcap_tables.R +++ b/R/read_redcap_tables.R @@ -35,7 +35,7 @@ read_redcap_tables <- function(uri, REDCapR::redcap_metadata_read(redcap_uri = uri, token = token)[["data"]] if (!is.null(fields)) { - fields_test <- fields %in% unique(m$field_name) + fields_test <- fields %in% c(m$field_name,paste(unique(m$form_name),"_complete")) if (any(!fields_test)) { print(paste0("The following field names are invalid: ",