How to reorder cld label on plot bars

23 views Asked by At

i'm new in R and I'm drawing some graphs. I have problems whith cld labels order on my graphs.

Afeter statistical analysis of my data (Anova and tukey test), i'm used this code for obtain cld from my tukey test (tk).

cld<-as.data.frame.list(cld$'Condition1:Condition2') tk$cld<-cld$Letters

On the bar plot I inverted the order of my item using the fct_rev command: ggplot(tk,aes(x=Condition2,y=mean,fill=fct_rev(Condition1))).

The cld letters don't follow the new order and in my graph i have the letter "b" before the "a", sometimes in the first bar i have he letter "d" and in the last one the letter "a".

It's possible to arrange the order of cld on the order of items?

I hope to have been clear, thanks.

0

There are 0 answers