Skip to content

Commit

Permalink
Apply automatic stylistic changes
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] committed May 8, 2024
1 parent 3c97c9a commit 177d71d
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions R/utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,20 @@
#' @importFrom DT %>%
mk.lev2 <- function(out.old, out.label) {
. <- variable <- val_label <- level <- NULL
label.value <- sapply(out.old, function(x) attr(x, "labels")) %>% .[!sapply(., is.null)] %>% sapply(function(x){dd <- names(x);names(dd) <- x;return(dd)})
label.value <- sapply(out.old, function(x) attr(x, "labels")) %>%
.[!sapply(., is.null)] %>%
sapply(function(x) {
dd <- names(x)
names(dd) <- x
return(dd)
})
label.variable <- sapply(out.old, function(x) attr(x, "label")) %>% .[!sapply(., is.null)]

for (v in names(label.variable)){
for (v in names(label.variable)) {
out.label[variable == v, var_label := label.variable[v]]
}
for (v in names(label.value)){
if (any(out.label[variable == v, class] != "numeric")){
for (v in names(label.value)) {
if (any(out.label[variable == v, class] != "numeric")) {
out.label[variable == v, val_label := label.value[[v]][level]]
}
}
Expand Down

0 comments on commit 177d71d

Please sign in to comment.