Skip to content

Commit

Permalink
Merge pull request #30 from wognsths/master
Browse files Browse the repository at this point in the history
.
  • Loading branch information
jinseob2kim authored Jul 18, 2024
2 parents 05a45ca + 7eab712 commit eb2a989
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Description: 'RStudio' addins and 'Shiny' modules for descriptive statistics, re
Depends: R (>= 3.4.0)
License: Apache License 2.0
Encoding: UTF-8
RoxygenNote: 7.3.1
RoxygenNote: 7.3.2
Imports:
data.table,
DT,
Expand Down
6 changes: 6 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# jsmodule 1.5.6

## Bugfix:
- Fix var_label displaying incorrectly when loading .sav file


# jsmodule 1.5.5

## Update
Expand Down
5 changes: 4 additions & 1 deletion R/utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,11 @@ mk.lev2 <- function(out.old, out.label) {
label.variable <- sapply(out.old, function(x) attr(x, "label")) %>% .[!sapply(., is.null)]

for (v in names(label.variable)) {
out.label[variable == v, var_label := label.variable[v]]
logical <- label.variable[[v]] %in% out.old[[v]]
tmp <- ifelse(sum(logical) > 0, rep(v, sum(logical)), label.variable[v])
out.label[variable == v, var_label := tmp]
}

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 eb2a989

Please sign in to comment.