Skip to content

Commit

Permalink
remove duplicated values in labels; fixed issue #79
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffeaton committed Feb 27, 2019
1 parent 2600f9e commit c728c4d
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions R/read_dhs_flat.R
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,9 @@ parse_dcf <- function(dcf, all_lower=TRUE) {
values <- Map("names<-", values, labels)
values <- lapply(values, function(x) x[!is.na(x) & nzchar(names(x))])

## remove duplicate values from labels
values <- lapply(values, function(x) x[!duplicated(x)])

dcf$labels[hasvs] <- values

## Expand dictionary for multiple occurences
Expand Down

0 comments on commit c728c4d

Please sign in to comment.