Create histogram by group

Screenshots are not easy for people to use to help you. Please try to share your data in one of these methods listed in here: FAQ: How to do a minimal reproducible example ( reprex ) for beginners For example, you could do something like this dput(head(df, 50)) to show the first 50 rows and share that with us.

In the mean time, it's good to know two things that might help your code.

  1. R is case-sensitive so instead of using group, you should use Group
  2. Is there an underscore in maize_acres, it doesn't appear so from the screenshot but hard to know until you share data that is easier to use
  3. You don't need to quote the variables and it would instead be something like this:
ggplot(df, aes(x=maize_acres, fill=Group, color=Group))+
    geom_histogram,(position="identity")
  1. If the first variable has a space in it, you need to refer to it in back ticks like this:
ggplot(df, aes(x=`Maize acres`, fill=Group, color=Group))+
    geom_histogram,(position="identity")