Skip to content

Commit

Permalink
Fix x label in 'gather_set_data' function
Browse files Browse the repository at this point in the history
  • Loading branch information
ycl6 committed Jul 20, 2023
1 parent 9be635c commit 1340f6a
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 1340f6a

Please sign in to comment.