mirror of
https://github.com/agdamsbo/REDCapCAST.git
synced 2024-10-30 03:21:53 +01:00
r-pkg: preserving order of columns in output tables
This commit is contained in:
parent
fc1cad40be
commit
91d9e8e8dd
|
@ -159,12 +159,12 @@ REDCap_split <- function(records, metadata) {
|
||||||
|
|
||||||
if (i == "") {
|
if (i == "") {
|
||||||
|
|
||||||
out_fields <- fields[!fields[,2] %in% subtables, 1]
|
out_fields <- which(vars_in_data %in% fields[!fields[,2] %in% subtables, 1])
|
||||||
out[[which(names(out) == "")]] <- out[[which(names(out) == "")]][out_fields]
|
out[[which(names(out) == "")]] <- out[[which(names(out) == "")]][out_fields]
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
out_fields <- c(repeat_instrument_fields, fields[fields[,2] == i, 1])
|
out_fields <- which(vars_in_data %in% c(repeat_instrument_fields, fields[fields[,2] == i, 1]))
|
||||||
out[[i]] <- out[[i]][out_fields]
|
out[[i]] <- out[[i]][out_fields]
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user