90 questions
0
votes
0
answers
26
views
Aluvial Graph Color, Label, and Ordering Issues
I'm trying to produce a Sankey plot, but every time I code it, either the left or right side ends up without color. Also, I'm having trouble getting correct the strongly agree, agree, neither, ...
1
vote
1
answer
41
views
Plotting alluvial plot using different categories of one variable
I am attempting to plot something like the following where x axis is InEx and ReA SFMC but they are two categories of the variable called "Group", y axis is variable called "n" (...
1
vote
1
answer
54
views
Alluvial plots using ggplot2 - highlight certain pairings
I have plotted an alluvial plot using ggplot2, however I cannot seem to figure out how to colour only the most frequent pair "CAGGFNYQLIW" from the variable "CTaa_alpha" which is ...
0
votes
0
answers
35
views
ggalluvial: Order flow of lines based on a variable so they converge when reaching the next stratum
I'm plotting an alluvial diagram in RStudio wth the below code. My original dataset is in wide format.
I want to plot it in a way that when flows (color defined by the variables in the first axis, &...
0
votes
1
answer
39
views
Adding markdown formatted text to ggalluvial plots
I wish to add formatting to some of the labels in various columns of the following alluvial plot:
library(ggplot2)
library(ggalluvial)
dataset <- data.frame(Gene = c("A1", "B2",...
1
vote
1
answer
95
views
Using ggalluvial, how can I color one stratum box and leave all others white
I am trying to create an alluvial plot with ggalluvial where the terminal stratum box color is the colors of the flows. I am unfortunately unable to keep other stratum colors from changing either to a ...
1
vote
1
answer
120
views
Alluvial diagram in R: Create an plot where the categories are aligned on the y-axis across time
How can I create an Alluvial-like diagram where the categories are hierarchically aligned on the y-axis (rather than fixed together) so that it does not look like individuals are going "downward&...
0
votes
0
answers
48
views
Creating an Alluvial plot with ggplot
I am trying to create an Alluvial Plot in R for longitudinal gene expression data. The code works fine and I kind of get what I need.
My problem is though, that I would like that the color code for ...
0
votes
1
answer
59
views
ggalluvial plot move and round flow percentages
I am adding flow percentages in my ggalluvial plot based on an existing StackOverflow case (how to calculate percentages in geom_flow() based on variable size and not stratum size) which works fine.
...
0
votes
1
answer
49
views
How do I set different strata order, drop label edges, and fix overlapping labels in r package ggalluvial?
I am trying to customize some ggalluvial plots in r and there are three aspects that I find difficult to set. I have inserted a dummy table for explanation below:
I would like to reorder the plot so ...
1
vote
0
answers
21
views
How do I sort two axis in geom_alluvium [duplicate]
When I sorted the rectangles and lines on the two axes of the relative alluvial plot, I found that using factor can only adjust one axis, while the other cannot. What should I do?
The data is as ...
1
vote
2
answers
128
views
Cannot re-order axes in ggalluvial
I have read through all of the ggalluvial posts that I can find about ordering the axes in an alluvial diagram. Each of my axes is a factor variable and I have set the levels to be in the order I wish ...
0
votes
0
answers
26
views
How to plot monthly purchase data using alluvial plot?
I have monthly data which shows 1. funds received in each month for a population and 2. purchase done for different materials in the form of frequency tables.
month
fund_recd_freq
june
20
july
35
...
1
vote
1
answer
82
views
How to colour all the stratum specifically in R with ggalluvial?
Here is my data frame:
library(ggalluvial)
allu1 <- tibble::tribble(
~transitionState_PB, ~DC_PIB, ~transitionState_PI, ~Freq,
"BATF3", "BATF3", ...
0
votes
0
answers
47
views
Aligning a tree structure with an alluvial plot using ggtreeExtra
I am trying to align a tree structure I made with ggtree to an alluvial plot I made with ggalluvial. Here is a simple example data and the code I used:
library(ggtreeExtra)
library(ggtree)
library(...
0
votes
1
answer
49
views
how to join dataflows in ggalluvial at a node
I have two datasets that show the flow of people between districts in 3 different time periods, where the middle time period (t2) is the unique link between the periods. Now I would like to draw a ...
0
votes
1
answer
83
views
ggalluvial with one value in axis1
I am supposed to make a ggalluvial with the following dataframe :
df <- data.frame(departure = c("Paris"), arrival = c("Nantes","Caen","Nice"), value = c(0....
2
votes
2
answers
196
views
R: How to wrap character columns to print to 2 lines in ggplot, but they're NOT titles?
There are myriad similar questions for splitting character strings to 2 lines with \n and cat (e.g.), paste (e.g.), strwrap (e.g.), and writeLines (e.g.). But all of these either anticipate the output ...
0
votes
0
answers
60
views
Sankey Diagram Showing Break Down Into Categories
I am looking to create a basic Sankey diagram using ggalluvial that breaks down a set of observations by an edit that is made. Please consider the following example:
library(data.table)
library(...
1
vote
2
answers
60
views
how to shift left only the 'label' text of the second node in geom_text
The problem is that I am graphing some sankeys and visually it is inefficient for me to see the labels this way, I would like to be able to integrate them to the left, there should be a simpler way ...
1
vote
1
answer
33
views
Show tow times change map with same color legend with ggalluvial
I have a map with 3 classes. I evaluated size of classes in two times.
I am using dplyr, ggplot and ggalluvial libraries to present changes from 'First' time to 'Second' time.
data.frame(
First = c(&...
1
vote
1
answer
303
views
How to fix ordering of the sankey diagramm when using R ggalluvial, ggsankey package?
Here is the input datasets:
id <- c("A1", "A2", "A3", "A4", "A5", "A6", "A7", "A8", "A9", "A10")
...
0
votes
0
answers
168
views
Alluvial Plot - Use Percents Instead of Frequencies
I am trying to create an alluvial plot using ggplot and the ggalluvial. I am less interested in the frequency change per position, but instead, I'm more interested in the percent change per position. ...
0
votes
1
answer
221
views
How to make a sankey graph using ggalluvial in R?
I am trying to make a Sankey graph using the ggalluvial package in R.
I have the following data:
ID Cluster3(values ranging from 1 to 3) Cluster 6 (values ranging from 1 to 6). x and y coordinates (as ...
2
votes
0
answers
154
views
ggalluvial or ggsankey - colours for different axis
I am trying to make an alluvial chart using ggalluvial on R. I was wondering if it is possible to have different colours for each segment (or between axis).
In the example below, I have A on axis one ...
0
votes
1
answer
190
views
Creating Sankey or Alluvial plot and stopping the flow where the "next_node" and "next_x" value is "NA" in R
I am trying to create a Sankey or Alluvial plot using the ggplot2 library in R to visualize the flow of nodes based on the provided CSV data. The data includes columns for 'x', 'node', 'next_x', and '...
1
vote
1
answer
388
views
ggalluvial: Control order of boxes/strata and line width
It's my first time using the ggalluvial package and I have problems to adapt the design for my purposes.
Consider this example data I came up with:
data <- data.frame(person = c(rep("x",5)...
2
votes
2
answers
310
views
how to calculate percentages in geom_flow() based on variable size and not stratum size
I am trying the create an alluvial plot with geom_flow() and display the percentages of the flows. This works, however if I use more than two variables, I noticed that the percentages in the middle ...
0
votes
0
answers
162
views
I want my stratum the same size in my alluvial graph
I'm making an alluvial graph in R with two stratum. Each stratum has the same categories but when I graph, it has different size for every category because the number of observations is different. ...
2
votes
1
answer
415
views
ggalluvial: How to order the lines between blocks to be in same order as your data.frame?
I have made an alluvia plot using the ggalluvial package in R. I am trying to order the flows (lines between blocks) so that they are much easier to read - I am aiming for them to be stacked on top of ...
0
votes
0
answers
98
views
How to correct strata boxes position in ggalluvial
I would like to align the strata boxes to the borders of the graph in ggalluvial plots, and cannot find the way to customize my plot accordingly.
I could not find the way to adjust their position ...
0
votes
0
answers
43
views
Why cant I get fluxes divided in ggalluvial plot?
I am new using the ggalluvial package. Currently I am working with a dataset of pixels forming different types of land cover. What I want to represent is the migration of pixels from one cover type to ...
0
votes
0
answers
598
views
ggalluvial Warning messages: 1: Computation failed in `stat_stratum()` Caused by error in `default_missing()`
I am trying to reproduce the solution given in this post, which includes a nice reproducible example
Formating dataframe for a ggalluvial plot between 2 categorical variables?
However, I cant get this ...
0
votes
1
answer
612
views
Changing size of alluvial plot boxes to include larger text in ggplot R?
I made an alluvial plot but I noticed that my labels are difficult to read in darker colour boxes. Ultimately, I want to have larger sized font, which means I also want taller size boxes. You will ...
0
votes
1
answer
671
views
Changing width of border lines in alluvial plot, ggplot R?
I have made an alluvial plot with ggplot, but I'm finding it's difficult to distinguish between the boxes. I do not want to change how it's coloured, but I am hoping to increase the line width around ...
0
votes
2
answers
380
views
Changing alpha/transparency of alluvial plot in ggplot R?
I have made an alluvial plot, but the colours are too transparent. I tried playing around with alpha = in my code but nothing happens. This is the code I'm using. I kept the alpha = in my code where ...
2
votes
1
answer
256
views
Group color/ flow so that the bars create a bar chart of first
I have a dataset that looks something like this:
results <- as.data.frame(cbind(c("Violence", "Violence", "Violence", "Violence", "Economic", &...
0
votes
1
answer
140
views
How to transform dataframe with duplicate rows into to_lodes_format?
I have a follow-up question to this one geom_flow question
When i duplicate the rows ggalluvial is not able to generate the flow charts mentioned in the discussion:
set.seed(42)
individual <- as....
2
votes
1
answer
905
views
Working with ggalluvial ggsankey library with missing combinations and dropouts
I'm trying to represent the movements of patients between several treatment groups measured in 3 different years. However, there're dropouts where some patients from 1st year are missing in the 2nd ...
0
votes
1
answer
564
views
showing label with ggalluvium
I tried adding label to a ggalluvial plot. I only have axis 1 and 2 and when I try to show label, it shows twice.
Here's my code :
ggplot(bdd_1,
aes(axis1 = Group_year1, axis2 = Group_year2, y=...
-1
votes
1
answer
284
views
Can't get geom_text to appear in ggalluvial
I have been using code that is verbatim to that in:
https://www.r-bloggers.com/2022/10/how-to-create-a-ggalluvial-plot-in-r/
in order to produce an alluvial plot. While I can get the plot to appear:
...
1
vote
1
answer
421
views
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"),
...
1
vote
1
answer
152
views
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 ...
1
vote
1
answer
202
views
Change the flow colours of a diagram [duplicate]
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&...
0
votes
3
answers
140
views
Change labels length in a plot
I try to run this option of a plot:
library(ggalluvial)
library(ggplot2)
library(dplyr)
df <- data.frame(status = c("open", "close", "close", "open/close", &...
-3
votes
1
answer
518
views
Alluvial plot for three variabes
From a dataframe like this:
data.frame(status = c("open", "close", "close", "open/close","close"),
stock = c("google", "...
1
vote
0
answers
517
views
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 ...
1
vote
1
answer
274
views
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 ...
1
vote
0
answers
229
views
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 ...
0
votes
1
answer
69
views
Aesthetics must be either length 1 or the same as the data: fill, y and axis1 [closed]
Aesthetics must be either length 1 or the same as the data (5): fill, y and axis1
Any suggestion would be appreiated.
Thank you!
Here's the background:
dim(fly)
Rows: 21,000
Columns: 4
head(fly,5)
...