I am preparing a plot for publication. I created a stacked box plot to show frequency of patients in each group who were some complicated accumulation of seronegatives versu
I found a hybrid way of doing it. It does relabel the factor but I do not have to do it in the dataframe. Instead I just do it in the ggplot command.
ggplot(data, aes(grp, fill=factor(outcome,labels=c("low","high")))) +
geom_bar() +xlab("group") +ylab("number of subjects") +
labs(fill="Serologic response")
Are there any other ways?