0

In R/ggplot2, how to combine 'table' and 'plot' ? As below, i want to add the 'data_table' to the ggplot2 image. (the result just as attached image which combine by manual) Anyone can help ? Thanks!

library(ggplot2)
library(gcookbook)
library(plyr)
library(formattable)
ce<-arrange(cabbage_exp,Date,Cultivar)

data_table <- formattable(ce)

data_plot <- ggplot(ce,aes(x=Date ,y=Weight,fill=Cultivar))+
  geom_bar(stat='identity')+
  geom_text(vjust=1,aes(label=Weight),position='stack')

enter image description here

Ronak Shah
  • 377,200
  • 20
  • 156
  • 213
anderwyang
  • 1,801
  • 4
  • 18

0 Answers0