data handling specific to repeated and/or longitudinal projects as been wrapped in if statement to allow handling of simple projects and just split instruments

This commit is contained in:
Andreas Gammelgaard Damsbo 2024-02-06 08:42:09 +01:00
parent 5979b972e1
commit 7c211250d8

View File

@ -92,13 +92,13 @@ REDCap_split <- function(records,
metadata <- metadata <-
as.data.frame(process_user_input(metadata)) as.data.frame(process_user_input(metadata))
# Process repeat instrument names to match the redcap naming
records$redcap_repeat_instrument <- clean_redcap_name(records$redcap_repeat_instrument)
# Get the variable names in the dataset # Get the variable names in the dataset
vars_in_data <- names(records) vars_in_data <- names(records)
# Process repeat instrument names to match the redcap naming
if (is.repeated_longitudinal(records)){
records$redcap_repeat_instrument <- clean_redcap_name(records$redcap_repeat_instrument)
# Match arg for forms # Match arg for forms
forms <- match.arg(forms, c("repeating", "all")) forms <- match.arg(forms, c("repeating", "all"))
@ -116,6 +116,7 @@ REDCap_split <- function(records,
as.character(records$redcap_repeat_instrument) as.character(records$redcap_repeat_instrument)
) )
} }
}
# Standardize variable names for metadata # Standardize variable names for metadata
# names(metadata) <- metadata_names # names(metadata) <- metadata_names
@ -198,3 +199,4 @@ REDCap_split <- function(records,
out out
} }