For this week's TidyTuesday challenge, I am trying to plot a stream graph of the top 5 male names and their frequencies. I am using the following code for this purpose
tuesdata <- tidytuesdayR::tt_load('2022-03-22')
babynames <- tuesdata$babynames
top5_male <- babynames %>%
filter (sex == "M") %>%
group_by(name) %>%
mutate(total = sum(n)) %>%
select(name, total) %>%
arrange(desc(total)) %>%
distinct(name, total) %>%
head(5)
babynames %>%
filter(name %in% c("James", "John", "Robert", "Michael", "William")) %>%
streamgraph("name", "n", "year")
However, when I run this code, it gives an error saying that
Warning message:
In widget_html(name = class(x)[1], package = attr(x, "package"), :
streamgraph_html returned an object of class `list` instead of a `shiny.tag`.
I looked up some solutions on the internet. However, none of them solved this problem. If you can help, I would be glad for that. Thank you in advance.
