Questions tagged [ggalluvial]

Use this tag for questions related to the ggalluvial package. The ggalluvial package extends the functionality of ggplot2 to make it easy to create alluvial charts in the R programming language.

The package extends the functionality of to make it easy to create alluvial charts in the programming language.

An overview and introduction to the package can be found on the package website

72 questions
1
vote
1 answer

Alluvial diagram with varying aesthetic / colors over one flow in R based on ggplot2

I have created the following alluvial diagram in R as follows: df <- data.frame(Variable = c("X1", "X2", "X3", "X4", "X5", "X6"), Pearson1 = c(6, 3, 2, 5, 4, 1), Spearman1 = c(6, 5, 1, 2, 3, 4), …
nickolakis
  • 621
  • 3
  • 7
1
vote
1 answer

Multistep alluvial diagram in R

I have a data frame in R with 6 categories Pearson1, Spearman1, Kendall1, Pearson2, Spearman2, and Kendall2 and I have 6 variables X1, X2, X3, X4, X5 and X6. In each category I have the ranking of the variables from highest to lowest, for example X1…
nickolakis
  • 621
  • 3
  • 7
1
vote
1 answer

Change the flow colours of a diagram

Is there any command to set your own pallet? In a plot like this: library(ggalluvial) library(ggplot2) library(dplyr) df <- data.frame(status = c("open", "close", "close", "open/close", "close"), stock = c("google", "amazon",…
Erik Brole
  • 315
  • 9
1
vote
0 answers

How to create a circular alluvial plot in R?

I have been looking through alluvial plots in r on Stack Overflow and all of the ones I see are either horizontal or vertical but not circular. Does anyone know if this is possible to do in r? So far the code i've been working on has just led me to…
IzOss
  • 25
  • 2
1
vote
1 answer

Find the intersection of all combination of list of list

My ultimate goal is to have alluvial plots in R. However, my data is big and is not stored in a way that can be used for direct input, I have: 4 groups (they will be axes of the alluvial plot) In each of these groups consist of a list of a list of…
William Wong
  • 453
  • 2
  • 9
1
vote
0 answers

Change size of label/legend in alluvial plot (ggalluvial) and split a categorical variable with many categories in half

I´m trying to alter a basic alluvial plot in order to fit my data and I have two separate issues: two of the categories (A1 & A2) within my main variable (index) are much much larger in relation to the others which makes the rest of the outcomes to…
Chrysa
  • 11
  • 3
1
vote
2 answers

Grouping legend of ggplot for stacked bar chart

Let say I have below ggplot to draw a stacked bar chart library(ggplot2) col_define = c('red', 'orange', 'blue', 'lightblue') names(col_define) = c('A', 'B', 'C', 'D') data = rbind(data.frame('grp1' = 'X', 'grp2' = c('A', 'B', 'C', 'D'), 'val' =…
Bogaso
  • 2,838
  • 3
  • 24
  • 54
1
vote
1 answer

Add custom label in the middle in Alluvial plot

I have below Alluvial plot library(ggplot2) library(ggalluvial) data = structure(list(val = c(10, 30, 15, 30, 40, 12, 10, 30, 15), name = c("A", "B", "C", "A", "B", "C", "A", "B", "C"), group = c("gr1", "gr1", "gr1", "gr2", "gr2", "gr2", "gr3",…
Brian Smith
  • 1,200
  • 4
  • 16
1
vote
1 answer

Create Flow chart in R

I am trying to make either a multi node Sankey or Alluvial plot whichever is more appropriate. The output would be similar to this which is from the ggalluvial packgage vignette here gg alluvial vignette The difference would be that my time_period…
te time
  • 485
  • 3
  • 9
1
vote
1 answer

R ggplot2 alluvial plot with simple data

I'm very new to making graphs in R and I'm having a hard time producing a simple alluvial plot. My data is basically something like this (I've already aggregated it): data<-tibble(working_2019=c("Yes", "No", "Yes", "No"), …
mau
  • 11
  • 2
1
vote
1 answer

How to create an alluvial plot in ggplot2 with ggalluvial package?

I'm trying to create an alluvial plot in ggplot2 with the ggalluvial package. Here are the two helpful websites I've been using to create the plot: site 1 and site 2. My goal is to use the same code found on site 1 but apply it to my own df, as…
Sly
  • 25
  • 4
1
vote
1 answer

Using ggalluvial with nodes holding different values

My data is a set of activities completed by persons. The sequence of activities a person takes varies. The data below show the activities for each step (Step1, Step2, etc). I'd like an alluvial plot that labels the activities at each step (each a…
Ben
  • 1,113
  • 10
  • 26
1
vote
1 answer

Data is not in a recognized alluvial form

I am trying to do an alluvial plot which compares ordination methods after clustering. The idea is to have 3 variables on the x axis, corresponding to PCA, PCoA and PLN Model. I would like to "cut" each one of these into 4 parts (4 clusters given by…
Droidux
  • 146
  • 2
  • 12
1
vote
1 answer

Issue with preparing dataset for use with ggalluvial and creating alluvial diagram

I am new to using the ggalluvial package. I presently am working with a dataset of donations that I would like to represent using an alluvial diagram as a medium. Below is a sample of the dataset that I am working with: donor_ID recip_name…
AML
  • 35
  • 3
1
vote
1 answer

How to use an Alluvial Plot (or Sankey diagram) to show change of categories over time using R

I am trying to use an Alluvial plot (Sankey diagram) to show the change of different categories over two time periods. I was able to create a plot that makes sense to me when all the factor levels are represented in both time periods (pre and post),…
user1626688
  • 1,583
  • 4
  • 18
  • 27