It’s been a couple of days, so I’m sorry if this is too late to be helpful.
One thing I see here is that you’re changing museums_df in the pipe and storing it as museum_stacked, but then you’re feeding ggplot the original museums_df data frame. I haven’t piped things directly into ggplot, but I assume it works like other pipes, and you don’t need to specify the data frame you’re referencing. If you take the museums_df argument out of the ggplot call, I think you’ll pipe in the museums_stacked data frame you’ve just created.
I believe factor() is a function, not a separate argument. Try this:
ggplot(aes(x = factor(Region.Code…AAM., fill = Is.Museum))
**Note that I didn’t specify a data frame because of your piping. Without the pipes, you’d just have museums.stacked as the first argument.
That tells R, even though the values of Region.Code…AAM. are numbers, treat the numbers as names and not as actual numbers.
Hope that helps.