ggalluvial | ggplot2 extension for alluvial plots | Data Visualization library
kandi X-RAY | ggalluvial Summary
kandi X-RAY | ggalluvial Summary
This is a ggplot2 extension for alluvial plots.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of ggalluvial
ggalluvial Key Features
ggalluvial Examples and Code Snippets
Community Discussions
Trending Discussions on ggalluvial
QUESTION
I have this data:
https://docs.google.com/spreadsheets/d/18sTSOzVEmSEI2KGfGSvRT_0BbzQ9n87kCGZH-cSULCs/edit?usp=sharing (put below the code to produce it)
I use this code:
...ANSWER
Answered 2022-Mar-29 at 12:04You need to specify the fill color according to the first axis variable. The labels are going to be difficult to place in view of their size and the limited space of some of the nodes, but something like this might work for you:
QUESTION
I'm trying to write up a report and simply want to include a .jpeg image in my write up. However, whenever i knit together my document, I get the following error:
...ANSWER
Answered 2022-Mar-28 at 17:25I had the same issue and it seems you will need to pass the absolute path. See this .
Instead of using here
maybe try using normalizePath
in include_graphics
.
So omit your call here()
, which may not be propagating across chunks (I don't know, because I can't see your chunks), and do:
QUESTION
ANSWER
Answered 2022-Mar-22 at 16:11You could add a plain old geom_label
:
QUESTION
I have the following example:
...ANSWER
Answered 2022-Feb-18 at 14:41Are you looking for aes.flow = "backward"
?
QUESTION
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:
...ANSWER
Answered 2022-Jan-30 at 13:59Currently the errors thrown by the plot layers are less informative than those thrown by the alluvial structure tests themselves. The tests also use different terms: id
for alluvium
, key
for x
, and value
for stratum
. (I apologize for that! These will be changed in a future release.) Your data are trying to be in lodes (long) form, and the is_lodes_form()
test (below) says that there are duplicate id–axis pairings.
I didn't notice earlier, but there is indeed at least one duplicative pairing: There are two rows with donor_ID = 1
and month_year = September 2019
. Alluvial plots require that each alluvium (id) pass through each axis at most once. After removing this one and another, an alluvial plot does render (below). Presumably because this is only a sample of the data, the plot is sparse.
QUESTION
I'd like to draw a Sankey diagram based on the variable time
. Basically, I'd like to have time
on the y axis and temperatures
and humidity
grouped by date
on the x axis. As you can see, the time is not displayed correctly. Why? Also, how can I change the size of the humidity
column to fit in the box?
Sample code:
...ANSWER
Answered 2022-Jan-06 at 23:14From what I understand of the y-axis mentioned, you are trying to achive something like this (this is how far I got)... maybe check out other libraries:
QUESTION
How do I add label names in the white boxes to each of the three axis on the ggalluvial sankey plot from the dataframe? (see image)
Column "Country" has observations for multiple countries. In the example below I am focused on Ireland which has the label "IE". How do I harvest the dataframe for the Country name using the ggplot code below? I will also be doing this task for the "Vaccine" and the "TargetGroup" names so if the solution can include these columns too, I would be grateful. Thank you
Dataframe code and sankey colours - data is from the EU ECDC
...ANSWER
Answered 2022-Jan-03 at 00:56Figured it out - full code chunk here. I hope this helps someone out
QUESTION
I am making a Sankey diagram with ggalluvial
.
Here is my dataset
...ANSWER
Answered 2021-Dec-11 at 18:29In the end, ggaluvial
seems more adapted to my problem:
Here is the data formating:
QUESTION
I have experience with making alluvial plots using the ggalluvial
package. However, I have run in to an issue where I am trying to create an alluvial plot with two different sources that converge onto 1 variable.
here is example data
...ANSWER
Answered 2021-Dec-10 at 17:58This plot is the expected result of the "flow" statistical transformation, which is the default for the "flow" graphical object. (That is, geom_flow()
= geom_flow(stat = "flow")
.) It looks like what you want is to specify the "alluvium" statistical transformation instead. Below i've used all your code but only copied and edited the ggplot()
call.
QUESTION
I am getting problems with applying ggrepel()
in an alluvial plot with different variables on columns. Some observations are so small, I need ggrepel
to make them readable.
Because there are three columns, I want to apply different ggrepel()
functions to each column:
Left (region
): Align lables to the left of axis
Middle (supplySector
): Do nothing (i.e. leave text in axis)
Right (demandSector
): Align to right of axis.
I've found these issues:
https://cran.r-project.org/web/packages/ggalluvial/vignettes/labels.html
and
How to align and label the stratum in ggalluvial using ggrepel (or otherwise)
Difference is: these examples only have 2 columns, and also columns made of the same variable (but subset of the variable). Previous published fixes are through an ifelse()
, selecting a subset within the variable.
ReprEx:
...ANSWER
Answered 2021-Nov-01 at 14:56Maybe I got you wrong. But after a closer look at your example I would call it a duplicate to my answer you linked in your post.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install ggalluvial
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page