首先构造数据 dat=data.frame(name=LETTERS[1:21], number=abs(rnorm(21)*10), type=c(rep("BP",7),rep("CC",7),rep("MF",7)) )# 请务必自己查看dat是一个什么数据,print出来即可# 然后对这个数据画图,一行代码即可!!!library(ggplot2) ggplot(dat,aes(x=n
GO:0000003 reproduction biological_process 52 3384 9842 GO:0022414 reproductive process biological_process 52 3384 9842 GO:0032502 developmental process biological_process 59 3384 9842 GO:0032501 multicellular organismal process biological_process 85 3384 9842 GO:0023052 signaling biological_process 183 3384 ...
shorten_names<-function(x,n_word=4){if(length(strsplit(x," ")[[1]])>n_word){return(paste(paste(strsplit(x," ")[[1]][1:n_word],collapse=" "),"...",sep=""))}else{return(x)}}labels=(sapply(levels(go_enrich_df$Description)[as.numeric(go_enrich_df$Description)],shorten_n...