[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"detail-sidebar-cat-0-en-105":3,"doc-seo-657210-105":59,"doc-detail-657210-en":130},{"code":4,"msg":5,"data":6},0,"success",[7,13,18,23,28,33,38,43,48,51,55],{"id":8,"doc_module":4,"doc_module_name":9,"category_name":10,"show_sort_weight":11,"slug":12},1,"Document","Story & Novel",90,"story-novel",{"id":14,"doc_module":4,"doc_module_name":9,"category_name":15,"show_sort_weight":16,"slug":17},2,"Literature",80,"literature",{"id":19,"doc_module":4,"doc_module_name":9,"category_name":20,"show_sort_weight":21,"slug":22},4,"Exam",70,"exam",{"id":24,"doc_module":4,"doc_module_name":9,"category_name":25,"show_sort_weight":26,"slug":27},5,"Comic",60,"comic",{"id":29,"doc_module":4,"doc_module_name":9,"category_name":30,"show_sort_weight":31,"slug":32},6,"Technology",50,"technology",{"id":34,"doc_module":4,"doc_module_name":9,"category_name":35,"show_sort_weight":36,"slug":37},7,"Healthcare",40,"healthcare",{"id":39,"doc_module":4,"doc_module_name":9,"category_name":40,"show_sort_weight":41,"slug":42},8,"Research & Report",30,"research-report",{"id":44,"doc_module":4,"doc_module_name":9,"category_name":45,"show_sort_weight":46,"slug":47},9,"Religion & Spirituality",20,"religion-spirituality",{"id":46,"doc_module":4,"doc_module_name":9,"category_name":49,"show_sort_weight":46,"slug":50},"World Cup","world-cup",{"id":52,"doc_module":4,"doc_module_name":9,"category_name":53,"show_sort_weight":52,"slug":54},10,"Lifestyle","lifestyle",{"id":56,"doc_module":4,"doc_module_name":9,"category_name":57,"show_sort_weight":24,"slug":58},19,"General","general",{"code":4,"msg":60,"data":61},"ok",{"site_id":62,"language":63,"slug":64,"title":65,"keywords":66,"description":67,"schema_data":68,"social_meta":123,"head_meta":125,"extra_data":127,"updated_unix":129},105,"en","ggalluvial-layered-grammar-for-alluvial-plots","ggalluvial - Layered Grammar for Alluvial Plots","","Alluvial diagrams visualize multidimensional or repeated-measures categorical or ordinal data using stacked bar plots with variable-width ribbons. The ggalluvial package extends the layered grammar of ggplot2 and enables alluvial diagrams directly from tidy data, anchored to a rigid graphics grammar for precise semantics and combinatorial plot construction. It distinguishes alluvial plots from Sankey and parallel sets, provides strata, alluvia, lodes, and flows as stat–geom layers, and supports long and wide data formats with custom aesthetics and ordering controls.",{"@graph":69,"@context":122},[70,84,105],{"@type":71,"itemListElement":72},"BreadcrumbList",[73,77,79,82],{"item":74,"name":75,"@type":76,"position":8},"https://docshare.wps.com","Home","ListItem",{"item":78,"name":9,"@type":76,"position":14},"https://docshare.wps.com/document/",{"item":80,"name":30,"@type":76,"position":81},"https://docshare.wps.com/document/technology/",3,{"item":83,"name":65,"@type":76,"position":19},"https://docshare.wps.com/document/ggalluvial-layered-grammar-for-alluvial-plots/657210/",{"url":83,"name":65,"@type":85,"image":86,"author":91,"headline":65,"publisher":94,"fileFormat":97,"inLanguage":63,"description":67,"dateModified":98,"datePublished":99,"encodingFormat":97,"isAccessibleForFree":100,"interactionStatistic":101},"DigitalDocument",{"url":87,"@type":88,"width":89,"height":90},"https://docshare.wps.com/thumbnails/ggalluvial-layered-grammar-for-alluvial-plots/657210.png","ImageObject",300,407,{"name":92,"@type":93},"Cipher","Person",{"url":74,"name":95,"@type":96},"DocShare","Organization","application/pdf","2026-10-28","2026-10-26",true,{"@type":102,"interactionType":103,"userInteractionCount":14},"InteractionCounter",{"@type":104},"ViewAction",{"@type":106,"mainEntity":107},"FAQPage",[108,114,118],{"name":109,"@type":110,"acceptedAnswer":111},"What does ggalluvial add to the R ecosystem for creating alluvial diagrams?","Question",{"text":112,"@type":113},"ggalluvial extends ggplot2’s layered grammar to generate alluvial diagrams from tidy data, giving clearer semantics and many combinatorial possibilities. It also adopts a distinct terminology to separate alluvial plots from Sankey and parallel sets plots.","Answer",{"name":115,"@type":110,"acceptedAnswer":116},"Which plot layers does ggalluvial use to build an alluvial visualization?",{"text":117,"@type":113},"It uses stat/geom pairs for strata (stacked bars), alluvia (ribbons connecting categories), lodes (subdivisions created by intersections), and flows (segments of alluvia between strata).",{"name":119,"@type":110,"acceptedAnswer":120},"How can tidy data be formatted for ggalluvial, and what aesthetics are required?",{"text":121,"@type":113},"Alluvial layers can be interpreted from either long format (one row per lode) or wide format (one row per alluvium). The package then requires custom aesthetics: stratum and/or alluvium plus x for long format, or axis specifications such as axis1 and axis2 for wide format.","https://schema.org",{"og:url":83,"og:type":124,"og:title":65,"og:site_name":95,"og:description":67},"article",{"robots":126,"canonical":83},"index,follow",{"doc_id":128,"site_id":62},657210,1793030285,{"code":4,"msg":5,"data":131},{"doc_id":128,"user_id":132,"nickname":92,"user_avatar":133,"doc_module":4,"category_id":29,"category_name":30,"doc_title":65,"doc_description":67,"doc_content":134,"file_id":135,"file_url":136,"file_type":137,"file_size":138,"view_count":14,"is_deleted":4,"is_public":8,"is_downloadable":8,"audit_status":8,"page_count":29,"language":139,"language_code":63,"site_id":62,"html_lang":63,"table_of_contents":140,"faqs":141,"seo_title":142,"seo_description":67,"update_tm":143,"read_time":144},687208528416,"https://ap-avatar.wpscdn.com/davatar_9964176cb1d06d4a9deccf72a44ae3dc","ggalluvial: Layered Grammar for Alluvial Plots  \nJason Cory Brunson1  \nDOI: 10.21105/joss.02017 Software  \n• Review   \n• Repository   \n• Archive   \nEditor: Anisha Keshavan  Reviewers:  \n• @clauswilke  \n• @tweed1e  \nSubmitted: 05 December 2019  \nPublished: 21 May 2020  \nLicense  \nAuthors of papers retain copyright and release the work under a Creative Commons Attribution 4.0 International License (CC-BY) .  \n1 Center for Quantitative Medicine, UConn Health  \nSummary  \nAlluvial diagrams use stacked bar plots and variable-width ribbons to represent multidimensional or repeated-measures data comprising categorical or ordinal variables (Bojanowski & Edwards, 2016; Rosvall & Bergstrom, 2010) . The ggalluvial package extends the layered grammar of graphics of ggplot2 (Wickham, 2016) to generate alluvial diagrams from tidy data (Wickham, 2014) .  \nThe package makes two key contributions to the R ecosystem. First, ggalluvial anchors the imprecise notion of an alluvial diagram to the rigid grammar of graphics (Wilkinson, 2006), which lends the plots more precise meaning and opens up many combinatorial possibilities. Second, ggalluvial adopts a distinctive geological nomenclature to distinguish “alluvial plots”and their graphical elements from Sankey diagrams and parallel sets plots, which I hope prove useful as these visualization tools converge toward common standards.  \nFunctionality  \nThe primary vignette thoroughly describes and illustrates the functionality of ggalluvial, and the reader is encouraged to browse the package documentation for comprehensive examples. In brief, the package contains stat and geom functions to add the following layers to a ggplot2 object:  \n• strata , or stacked bar plots, located in parallel along a (plotting) axis of (variable) axes or dimensions  \n• alluvia, ribbons through strata that connect the categories of individual cases or cohorts at different axes  \n• lodes, subdivisions of strata by their intersections with alluvia  \n• flows, segments of alluvia between strata  \nFigure 1 illustrates these and other plot elements by visualizing changes in several students’curricula (based on their declared majors) across several academic terms. Each axis corresponds to an odd-valued term (1 through 15), at which the students are grouped into strata according to their curricula—Art History, Ceramic, etc. The individual students can be tracked from term to term along their alluvia: for instance, one student started out in Digital Art, encoded by the blue ribbon, but had switched to Painting by the 11th term, where the ribbon turns pink. The partially transparent flows are colored according to their originating (not their terminating) terms, and the lodes where they intersect the strata are obscured by the solid-colored strata themselves. When a student’s curriculum is unknown, they are grouped into the “missing”(NA) stratum, which is weighted negatively in this example.  \nBrunson, J. C. , (2020) . ggalluvial: Layered Grammar for Alluvial Plots. Journal of Open Source Software, 5(49), 2017 . [https://doi.org/10.](https://doi.org/10. 1)[ 1](https://doi.org/10. 1)[ ](https://doi.org/10. 1)[21105/joss.02017](21105/joss.02017)  \nFigure 1: Alluvial plot of changes in curricula by a cohort of art students  \nPlot layers are formed by pairing stats (statistical transformations) with geoms (mappings to graphical elements and properties); while every stat and geom has a conventional default, alternative grammatical pairings provide combinatorial richness to plotting possibilities. In the above example, the alluvium geom was paired with the flow stat, so that the flows of each alluvium could change color across the axes. Other meaningful stat–geom combinations can be found in the documentation, including pairings of the three alluvial stats (stratum, alluvium, and flow) with the text, errorbar, and pointrange geoms.  \nAlluvial layers can interpret tidy data in either of two formats: long (one row per lode) and wide (one row","cbCaipOAhbqIUsga","https://ap.wps.com/l/cbCaipOAhbqIUsga","pdf",201751,"English","# Summary\n## Functionality\n## Concepts","[{\"question\":\"What does ggalluvial add to the R ecosystem for creating alluvial diagrams?\",\"answer\":\"ggalluvial extends ggplot2’s layered grammar to generate alluvial diagrams from tidy data, giving clearer semantics and many combinatorial possibilities. It also adopts a distinct terminology to separate alluvial plots from Sankey and parallel sets plots.\"},{\"question\":\"Which plot layers does ggalluvial use to build an alluvial visualization?\",\"answer\":\"It uses stat/geom pairs for strata (stacked bars), alluvia (ribbons connecting categories), lodes (subdivisions created by intersections), and flows (segments of alluvia between strata).\"},{\"question\":\"How can tidy data be formatted for ggalluvial, and what aesthetics are required?\",\"answer\":\"Alluvial layers can be interpreted from either long format (one row per lode) or wide format (one row per alluvium). The package then requires custom aesthetics: stratum and/or alluvium plus x for long format, or axis specifications such as axis1 and axis2 for wide format.\"}]","ggalluvial - Layered Grammar for Alluvial Plots | PDF",1792975795,15]