Skip to content

Commit

Permalink
Merge branch 'main' into data_rename_changes
Browse files Browse the repository at this point in the history
  • Loading branch information
rempsyc authored Dec 13, 2024
2 parents ea13de6 + 1ee2f80 commit 2a3717b
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions R/report_sample.R
Original file line number Diff line number Diff line change
Expand Up @@ -181,13 +181,16 @@ report_sample <- function(data,
unique(groups),
new_column = ".old_names",
separator = "."
)[[".old_names"]]
)[".old_names"]

new_names <- datawizard::data_unite(
unique(groups),
new_column = ".new_names",
separator = ", "
)[[".new_names"]]
result <- datawizard::data_rename(result, select = old_names, replacement = new_names)
)[".new_names"]

name_map <- stats::setNames(new_names[[1]], old_names[[1]])
names(result) <- name_map[names(result)]
}
# remember values of first columns
variable <- result[[1]]["Variable"]
Expand Down

0 comments on commit 2a3717b

Please sign in to comment.