Tag Archives: Error in inherits

[Solved] Error in inherits(x, “theme”): argument “e2” is missing, with no default

Run the code in Rstudio

p<-ggplot(outfile,aes(x = type,y = log2FoldChange))+geom_bar(stat = ' identity ' ,fill = ' #FF9999 ' )+geom_text(label=sig,colour = ' blue ' ,vjust = 1 ,check_overlap = TRUE,size = 7 )
 +theme(axis.text = element_text(size = 14 ))

An error occurred

Error in inherits(x, " theme " ): argument " e2 "  is missing, with no default

This is because the + is at the beginning, and the theme() statement cannot be connected to the previous statement. Just put + at the end of the previous statement