Split a dataset imported from Redcap into convenient subsets
Source:R/loadData.R
split_redcap_dataset.Rd
This function seperates a datasets into three parts: "Singular" data, which is the
data from non-repeating instruments. "missings_everywhere", which is data which is missing for each row.
The last parts are all the repeating instruments, which are referred to by their name as recorded in
dat$redcap_repeat_instrument
.
Arguments
- dat
a
tibble
produced byread_redcap_formatted
.- id_name
(character) the name of the subject ID variable.
Examples
path_to_redcap_script <- system.file("examples", "testredcap.r", package = "DescrTab2")
dat <- read_redcap_formatted(path_to_redcap_script)
d <- split_redcap_dataset(dat, guess_ID_variable(dat, TRUE))