p <- ggplot(as.data=data_p, mapping = aes(x = vote/100, y = party_name2, fill = factor(year),
group = party_name2, color = party_name2))
p + geom_bar(stat = "identity", position = position_dodge2(width = 0.9, preserve = "single")) +
geom_col() +
geom_text(size=2.3,color="black",position = position_dodge2(width = 0.9,preserve = "single"),hjust = -0.1,
mapping = aes(label = scales::percent(vote/100,accuracy=0.1)) +
labs(title = "Fylgi flokkanna í Alþingiskosningum 2009-2017",y = NULL,x = NULL,fill = "Flokkar") +
geom_col() + scale_color_manual(values=c("#808080", "#92278F", "#FF8C00", "#FFCA3E", "#A0D067", "#002169", "#512483", "#EA0038", "#00ADEF", "#FF7D14", "#00B878")) +
scale_fill_manual("#101010","#404040","#707070","#909090") +
scale_alpha_continuous(labels = scales::percent_format(accuracy = 1),limits = c(0,0.33))
..........................................................................................................................................................................
Sometimes this code runs but doesn't show a graph and sometimes this error comes up: Error: unexpected symbol in:
" scale_alpha_continuous(labels = scales::percent_format(accuracy = 1),limits = c(0,0.33))
p"
..........................................................................................................................................................................
I have it connected to google sheets. What can I do to make the code work and the graph show?