Saya mencoba menggunakan fungsi plot_grid dari cowplot untuk membuat plot khusus dengan dendrogram di baris atas dan dua tabel (bersebelahan) di baris kedua. Sekarang yang terjadi adalah dendrogram dan tabel saya diplot, tetapi pada dua PDF terpisah. Apakah ada cara agar semuanya berada pada halaman yang sama? Di bawah ini cuplikan kode saya:
pdf("test.pdf", width = 12, height = 10)
x <-tableGrob(frames[[1]])
y <-tableGrob(frames[[2]])
plot.clus <-plot(test1,label=diseaseDuration,main=label)
tables<-grid.arrange(x,y,nrow=1)
plot_grid(bottom_row,tables)
cuplikan keluaran dput untuk pengelompokan (hclust):
structure(list(merge = structure(c(-61L, -41L, -49L, 1L, -16L...),
height = c(4.23833720098634e-13, 6.36507320251999e-13.......),
order = c(5L, 57L, 12L, 7L, 66L, 31L, 55L, 6L, 10L, 37L,..),
labels = c("ABC00001", "ABC00002", "ABC00003",......),
method = "ward.D",
call = hclust(d = data, method = "ward.D"), dist.method =
"euclidean"), .Names = c("merge", "height", "order", "labels", "method", "call", "dist.method"), class = "hclust")