Skip to content

Commit

Permalink
Merge pull request #80 from ropensci/issue-79
Browse files Browse the repository at this point in the history
remove duplicated values in labels; fixed issue #79
  • Loading branch information
OJWatson authored Feb 27, 2019
2 parents 2600f9e + c728c4d commit 8fe5a2d
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 8fe5a2d

Please sign in to comment.