Skip to content

Commit

Permalink
pair -> step in self-adjoin output
Browse files Browse the repository at this point in the history
  • Loading branch information
corybrunson committed Jun 26, 2018
1 parent 10a748a commit b09566a
Show file tree
Hide file tree
Showing 6 changed files with 107 additions and 155 deletions.
2 changes: 1 addition & 1 deletion R/geom-flow.r
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ GeomFlow <- ggproto(
aesthetics <- intersect(.color_diff_aesthetics, names(data))
# arrange data by aesthetics for consistent (reverse) z-ordering
data <- data[do.call(order, lapply(
data[, c("pair", aesthetics)],
data[, c("step", aesthetics)],
function(x) factor(x, levels = unique(x))
)), ]

Expand Down
14 changes: 7 additions & 7 deletions R/self-adjoin.r
Original file line number Diff line number Diff line change
Expand Up @@ -42,25 +42,25 @@ self_adjoin <- function(

# self-(inner )join `link` variables by `key` and `by`
adj <- dplyr::inner_join(
transform(data, pair = key_num)[, c("pair", by, link)],
transform(data, pair = key_num - 1)[, c("pair", by, link)],
by = c("pair", by),
transform(data, step = key_num)[, c("step", by, link)],
transform(data, step = key_num - 1)[, c("step", by, link)],
by = c("step", by),
suffix = suffix
)

# bind `keep.*` variables
if (!is.null(keep.x)) {
adj <- dplyr::left_join(
adj,
transform(data, pair = key_num)[, c("pair", by, keep.x)],
by = c("pair", by)
transform(data, step = key_num)[, c("step", by, keep.x)],
by = c("step", by)
)
}
if (!is.null(keep.y)) {
adj <- dplyr::left_join(
adj,
transform(data, pair = key_num - 1)[, c("pair", by, keep.y)],
by = c("pair", by)
transform(data, step = key_num - 1)[, c("step", by, keep.y)],
by = c("step", by)
)
}

Expand Down
144 changes: 48 additions & 96 deletions docs/articles/ggalluvial.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

96 changes: 48 additions & 48 deletions docs/articles/labels.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file modified docs/articles/labels_files/figure-html/ggrepel-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit b09566a

Please sign in to comment.