Variable in group_by and ggplot

Can you supply some sample data? See FAQ: How to do a minimal reproducible example ( reprex ) for beginners