Running examples in ‘ggalluvial-Ex.R’ failed
The error most likely occurred in:

> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: alluvial-data
> ### Title: Check for alluvial structure and convert between alluvial
> ###   formats
> ### Aliases: alluvial-data is_lodes_form is_alluvia_form to_lodes_form
> ###   to_alluvia_form
> 
> ### ** Examples
> 
> # Titanic data in alluvia format
> titanic_alluvia <- as.data.frame(Titanic)
> head(titanic_alluvia)
  Class    Sex   Age Survived Freq
1   1st   Male Child       No    0
2   2nd   Male Child       No    0
3   3rd   Male Child       No   35
4  Crew   Male Child       No    0
5   1st Female Child       No    0
6   2nd Female Child       No    0
> is_alluvia_form(titanic_alluvia,
+                 weight = "Freq")
[1] TRUE
> # Titanic data in lodes format
> titanic_lodes <- to_lodes_form(titanic_alluvia,
+                                key = "x", value = "stratum", id = "alluvium",
+                                axes = 1:4)
> head(titanic_lodes)
  Freq alluvium     x stratum
1    0        1 Class     1st
2    0        2 Class     2nd
3   35        3 Class     3rd
4    0        4 Class    Crew
5    0        5 Class     1st
6    0        6 Class     2nd
> is_lodes_form(titanic_lodes,
+               key = "x", value = "stratum", id = "alluvium",
+               weight = "Freq")
[1] TRUE
> # again in lodes format, this time diffusing the `Class` variable
> titanic_lodes2 <- to_lodes_form(titanic_alluvia,
+                                 key = variable, value = value,
+                                 id = passenger,
+                                 1:3, diffuse = Class)
> head(titanic_lodes2)
  passenger Class Survived Freq variable value
1         1   1st       No    0    Class   1st
2         1   1st       No    0      Sex  Male
3         1   1st       No    0      Age Child
4         2   2nd       No    0    Class   2nd
5         2   2nd       No    0      Sex  Male
6         2   2nd       No    0      Age Child
> is_lodes_form(titanic_lodes2,
+               key = variable, value = value, id = passenger,
+               weight = Freq)
[1] TRUE
> 
> # curriculum data in lodes format
> data(majors)
> head(majors)
  student semester curriculum
1       1    CURR1   Painting
2       2    CURR1   Painting
3       6    CURR1   Sculpure
4       8    CURR1   Painting
5       9    CURR1   Sculpure
6      10    CURR1   Painting
> is_lodes_form(majors,
+               key = "semester", value = "curriculum", id = "student")
[1] TRUE
> # curriculum data in alluvia format
> majors_alluvia <- to_alluvia_form(majors,
+                                   key = "semester", value = "curriculum",
+                                   id = "student")
> head(majors_alluvia)
  student    CURR1       CURR3       CURR5    CURR7    CURR9   CURR11   CURR13
1       1 Painting    Painting    Painting Painting Painting Painting Painting
2       2 Painting    Painting    Painting Painting Painting Painting     <NA>
3       6 Sculpure    Sculpure    Painting Painting Painting Painting Painting
4       8 Painting    Painting    Painting Painting     <NA> Painting Painting
5       9 Sculpure Art History Art History Painting Painting Painting Painting
6      10 Painting    Painting    Painting Painting Painting Painting     <NA>
    CURR15
1 Painting
2     <NA>
3 Painting
4 Painting
5 Painting
6     <NA>
> is_alluvia_form(majors_alluvia, tidyselect::starts_with("CURR"))
Missing alluvia for some stratum combinations.
[1] TRUE
> 
> # distill variables that vary within `id` values
> set.seed(1)
> majors$hypo_grade <- LETTERS[sample(5, size = nrow(majors), replace = TRUE)]
> majors_alluvia2 <- to_alluvia_form(majors,
+                                    key = "semester", value = "curriculum",
+                                    id = "student",
+                                    distill = "most")
Distilled variables: hypo_grade
> head(majors_alluvia2)
  student hypo_grade    CURR1       CURR3       CURR5    CURR7    CURR9
1       1          A Painting    Painting    Painting Painting Painting
2       2          D Painting    Painting    Painting Painting Painting
3       6          B Sculpure    Sculpure    Painting Painting Painting
4       8          B Painting    Painting    Painting Painting     <NA>
5       9          E Sculpure Art History Art History Painting Painting
6      10          A Painting    Painting    Painting Painting Painting
    CURR11   CURR13   CURR15
1 Painting Painting Painting
2 Painting     <NA>     <NA>
3 Painting Painting Painting
4 Painting Painting Painting
5 Painting Painting Painting
6 Painting     <NA>     <NA>
> 
> # options to distinguish strata at different axes
> gg <- ggplot(majors_alluvia,
+              aes(axis1 = CURR1, axis2 = CURR7, axis3 = CURR13))
> gg +
+   geom_alluvium(aes(fill = as.factor(student)), width = 2/5, discern = TRUE) +
+   geom_stratum(width = 2/5, discern = TRUE) +
+   geom_text(stat = "stratum", discern = TRUE, label.strata = TRUE)
Error in grid.Call.graphics(C_setviewport, vp, TRUE) : 
  VECTOR_ELT() can only be applied to a 'list', not a 'double'
Calls: <Anonymous> ... push.vp.vpTree -> push.vp -> push.vp.viewport -> grid.Call.graphics
Execution halted