Data is not in a recognized alluvial form (see `help('alluvial-data')` for details).

I need help with this. Not sure i understand why my data is not in a recognized alluvial form. I used exactly the majors example and set my data the same way.

alluviatable <- cleandata.pivot %>%
select(MRN, command_score_day, command_score)

alluviatable$command_score <- as.factor(alluviatable$command_score)
alluviatable$command_score_day <- as.factor(alluviatable$command_score_day)
alluviatable$MRN <- as.integer(alluviatable$MRN)

ggplot(alluviatable,
aes(x = command_score_day, stratum = command_score, alluvium = "MRN", fill = command_score)) +
scale_fill_brewer(type = "qual", palette = "Set2") +
geom_flow(stat = "alluvium", lode.guidance = "frontback",
color = "darkgray") +
geom_stratum() +
theme(legend.position = "bottom") +
ggtitle("Command Score across days")

is needed to provide useful guidance.

See the FAQ: How to do a minimal reproducible example reprex for beginners.

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.