hey!
I had this graph all ready and working last week; however, today when I went back and changed a couple of data points and then when to update the graph, I have been getting this warning message:
Warning message:
Removed 32 rows containing missing values (position_stack).
My code is as follows:
load("H:\\Personal\\provider3.csv")
d=read.csv("provider3.csv", header=T)
library(ggplot2)
library(dplyr)
library(forcats)
d <- arrange(d,
Date)
d$Date <- forcats::as_factor(as.character(d$Date,format="%b-%Y"))
totals<- d %>%
group_by(Date) %>%
summarise(total=sum(Appointments))
d %>%
mutate(Date = factor(Date,
levels = c("Jan-20", "Feb-20", "Jun-20", "Jul-20"))) %>%
ggplot(aes(fill=Provider, y=Appointments, x=Date)) +
geom_bar(position="stack", stat="identity") +
geom_text(data=totals, aes(x=Date, label=total, y=total, fill=NULL), nudge_y=10) +
theme_minimal() +
theme(text=element_text(size=18))
Here is a small sample of my data:
'data.frame': 32 obs. of 3 variables:
$ Provider : chr "MW" "JA" "IR" "AV" ...
$ Date : Factor w/ 4 levels "20-Feb","20-Jan",..: 1 1 1 1 1 1 1 1 2 2 ...
$ Appointments: int 69 66 54 66 0 6 17 14 81 80 ...
Last week my graph looked like this:
Now, it looks like this: