Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR R

r alluvial chart with NA

data(vaccinations)
levels(vaccinations$response) <- rev(levels(vaccinations$response))
ggplot(vaccinations,
       aes(x = survey, stratum = response, alluvium = subject,
           y = freq,
           fill = response, label = response)) +
  scale_x_discrete(expand = c(.1, .1)) +
  geom_flow() +
  geom_stratum(alpha = .5) +
  geom_text(stat = "stratum", size = 3) +
  theme(legend.position = "none") +
  ggtitle("vaccination survey responses at three points in time")
Source by cran.r-project.org #
 
PREVIOUS NEXT
Tagged: #alluvial #chart #NA
ADD COMMENT
Topic
Name
7+1 =