From 149c2747f42b04c6acc2a201ef4cafed75a76b55 Mon Sep 17 00:00:00 2001 From: Andreas Gammelgaard Damsbo Date: Wed, 4 Dec 2024 08:05:45 +0100 Subject: [PATCH] better test --- R/read_redcap_tables.R | 2 +- man/apply_factor_labels.Rd | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/R/read_redcap_tables.R b/R/read_redcap_tables.R index acf541c..b530333 100644 --- a/R/read_redcap_tables.R +++ b/R/read_redcap_tables.R @@ -220,7 +220,7 @@ apply_field_label <- function(data,meta){ #' @export #' apply_factor_labels <- function(data,meta=NULL){ - if (is.list(data)){ + if (is.list(data) && !is.data.frame(data)){ meta <- data$meta data <- data$data } else if (is.null(meta)) { diff --git a/man/apply_factor_labels.Rd b/man/apply_factor_labels.Rd index 03e8159..e4216b0 100644 --- a/man/apply_factor_labels.Rd +++ b/man/apply_factor_labels.Rd @@ -4,7 +4,7 @@ \alias{apply_factor_labels} \title{Preserve all factor levels from REDCap data dictionary in data export} \usage{ -apply_factor_labels(data, meta) +apply_factor_labels(data, meta = NULL) } \arguments{ \item{data}{REDCap exported data set}