Skip to content

Commit

Permalink
Fix x label in 'gather_set_data' function (#305)
Browse files Browse the repository at this point in the history
  • Loading branch information
ycl6 authored Jan 16, 2024
1 parent f0c079d commit 82f7b73
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion R/parallel_sets.R
Original file line number Diff line number Diff line change
Expand Up @@ -279,10 +279,11 @@ geom_parallel_sets_labels <- function(mapping = NULL, data = NULL,
#' @examples
#' data <- reshape2::melt(Titanic)
#' head(gather_set_data(data, 1:4))
#' head(gather_set_data(data, c("Class","Sex","Age","Survived")))
gather_set_data <- function(data, x, id_name = 'id') {
columns <- tidyselect::eval_select(enquo(x), data)
data[[id_name]] <- seq_len(nrow(data))
vec_rbind(!!!lapply(columns, function(n) {
vec_rbind(!!!lapply(names(columns), function(n) {
data$x <- n
data$y <- data[[n]]
data
Expand Down

0 comments on commit 82f7b73

Please sign in to comment.