From 82f7b7393f5c97cca35a2ce07a80f5482b430412 Mon Sep 17 00:00:00 2001 From: I-Hsuan Lin <9032946+ycl6@users.noreply.github.com> Date: Tue, 16 Jan 2024 18:28:40 +0000 Subject: [PATCH] Fix x label in 'gather_set_data' function (#305) --- R/parallel_sets.R | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/R/parallel_sets.R b/R/parallel_sets.R index cceec1db..683ccfe0 100644 --- a/R/parallel_sets.R +++ b/R/parallel_sets.R @@ -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