Trying to make a stacked bar plot with my data and I this error keeps popping up:
Error: geom_bar requires the following missing aesthetics: x and y
Run rlang::last_error() to see where the error occurred.
What does provider1.csv() do? should it be read.csv()? And are you sure the file shouldn't be "provider1.csv", rather than "provider1.cvs"? Assuming they are typos?
You don't need to use the load() function here either, as if you use read.csv() on the correctly spelled file in the second line, this should work.
You also don't need to extract the variables on their own (e.g. Provider <- d$Provider) as ggplot() will find the variables inside the d dataset.
All that said, I'm not sure why you're hitting the error as you are since these aesthetics are being provided to geom_bar() as needed. You might be better using geom_col() rather than geom_bar() and for this you don't need to specify stat = "identity".
Try the following:
library(ggplot2)
d <- read.csv("provider1.csv", header=T)
ggplot(d,aes(x=Provider, y=Appointments, fill=Date)) +
geom_col(position="fill")
If this doesn't work, check that the d dataset actually has the right variables in it by running names(d).
If you're still having problems, come back to us with the results of sessionInfo(), that'll give us some details about what your system looks like right now (including loaded packages and versions, etc...)