I created a flexdashboard using RMarkdown. I have gotten all but one of my graphics to work in the dashboard, but for the life of me I cannot get my gganimated map to work. It will run on its own, just not in the RMarkdown, flexdashboard template. I got the weirdest error code that makes no sense to me.
Below is my code and the error message. I appreciate your help!
mapData<- read_xlsx("State_AA_policies.xlsx") %>%
mutate(region = str_to_lower(region))
us <- map_data("state")
us<- us %>% left_join(mapData, by = "region") %>% drop_na(policies)
gg + geom_map(data=us, map=us, aes(x=long, y=lat, map_id=region, fill = policies), size=0.15) +
labs(x = NULL, y = NULL, color = "Legend") +
ggtitle("Nine States Banned Affirmative Action") +
theme(axis.ticks = element_blank()) +
theme(axis.text = element_blank())+
transition_manual(frames = region, cumulative = T)