0

I am trying to colour or label the outliers (in red) of the following plot with the corresponding column "protein", but the output says that "protein" is an unknown object. plot Thank you in advance for your kind help!

DF$conc_sig_lip<-as.factor(DF$conc_sig_lip)
p<- ggplot(DF,aes(x=conc_sig_lip, y=nbi))+
             geom_boxplot(outlier.colour= "red")+
  stat_summary(fun.y = mean, geom="point")+
  scale_y_log10()

this is the code that doesn't work:

DF$conc_sig_lip<-as.factor(DF$conc_sig_lip)
p<- ggplot(DF,aes(x=conc_sig_lip, y=nbi))+
             geom_boxplot(outlier.colour= protein)+
  stat_summary(fun.y = mean, geom="point")+
  scale_y_log10()
  • 2
    Can you supply a reproducible sample? Refer this https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example – Mohanasundaram Apr 27 '20 at 11:02
  • You don't seem to have included the part of the code that is causing the error, or included the data you are using. It won't be possible to help you without these. Could you try editing your question to include the results of typing `dput(head(DF))` in the console? – Allan Cameron Apr 27 '20 at 11:03

0 Answers0