Skip to content

Commit

Permalink
Fix incorrect labels when using encode_sets=TRUE
Browse files Browse the repository at this point in the history
  • Loading branch information
krassowski committed Apr 3, 2021
1 parent e843a8c commit cb9c515
Show file tree
Hide file tree
Showing 5 changed files with 230 additions and 6 deletions.
5 changes: 4 additions & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# Version 1.2.0

Unreleased
2021-04-03

Bux fixes:
- [critical] fixed display order of labels when using encode_sets=TRUE

Major improvements:
- manually specified intersections will now display empty intersections and non-exclusive intersections correctly #109
Expand Down
4 changes: 2 additions & 2 deletions R/data.R
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ sanitize_names = function(variables_names) {

encode_names = function(variables_names, avoid) {
sapply(
# using order ensures that alphabetic order is retained in case of equal degrees
# using rank ensures that alphabetic order is retained in case of equal degrees
# and that re-ordering columns in the dataframe will not lead to flickering of the result
as.character(order(variables_names)),
as.character(rank(variables_names)),
function (name) {
while (any(name %in% avoid)) {
name = name + 'x'
Expand Down
Loading

0 comments on commit cb9c515

Please sign in to comment.