I want to arrange the categories in the x axis of my heatmap in the order as in the excel file's Term order. But it automatically gets arranged in alphabatic order.
library(ggplot2)
library(reshape)
getwd()
x<-read.csv("R.csv",check.names = F)
y<-melt(x,id="Term")
ggplot(y,aes(variable, Term,fill=value))+geom_tile()+coord_flip()+
scale_fill_manual(values = c("#FFE5CC","#FF9934"),guide = guide_legend(reverse = TRUE))+
theme(legend.title = element_text(color = "black", size = 10),axis.title=element_blank(),
axis.text.x = element_text(angle = 90,vjust = .5,hjust = 1,color = "black",size="7"),
axis.text.y = element_text(color = "black",size="12"))+
scale_x_discrete(expand=expansion(0),limits=rev) +
scale_y_discrete(expand=expansion(0))